Compare commits

...

15 Commits

503 changed files with 52516 additions and 51946 deletions

BIN
代码/pandafighter.class Normal file

Binary file not shown.

149
代码/pandafighter.java Normal file
View File

@ -0,0 +1,149 @@
package com.pandafighter;
import robocode.*;
import java.awt.geom.Point2D;
import java.awt.Color;
public class pandafighter extends AdvancedRobot
{
double moveDirection;
enemyStat enemy = new enemyStat();
public void run()
{
setBodyColor(Color.black);
setGunColor(Color.WHITE);
setRadarColor(Color.WHITE);
setScanColor(Color.BLACK);
setBulletColor(Color.YELLOW);
setAdjustGunForRobotTurn(true);
setAdjustRadarForGunTurn(true);
setTurnRadarRightRadians(2*Math.PI); //让雷达一直转
while(true)
{
doFire();
doScannedRobot();
doMovement() ;
execute();
}
}
public void onScannedRobot(ScannedRobotEvent e)
{
enemy.updateStat(e, this);
}
public void doMovement()//随机移动
{ //程序首先判断运动是否完成若完成随机选出一个座标点移动到该点
if( Math.abs( getDistanceRemaining() ) < 1 )
{
double myX = getX();
double myY = getY();
double nextX, nextY; // the next point move to
nextX = Math.random() * ( getBattleFieldWidth() - 100 ) + 50;
nextY = Math.random() * ( getBattleFieldHeight() - 100 ) + 50;
double turnAngle =getAngle(myX,myY,nextX,nextY );
turnAngle = normalizeBearing( turnAngle - getHeadingRadians() );
double moveDistance = Point2D.distance( myX, myY, nextX, nextY );
double moveDirection = 1;
if ( Math.abs( turnAngle ) >Math.PI/2)
{
turnAngle = normalizeBearing( turnAngle + Math.PI);
moveDirection *= -1;
}
setTurnRightRadians( turnAngle );
setAhead( moveDirection * moveDistance ); }
}
public static double getAngle(double x1, double y1, double x2, double y2)
{
return Math.atan2( x2 - x1, y2 - y1 );
}
public void doScannedRobot()
{
if (getTime()-enemy.time>1)
{
setTurnRadarRightRadians(3*Math.PI);
}
else
{
double absolation_bearing=(getHeadingRadians()+enemy.relative_bearing)%(2*Math.PI);
double relative_radar_bearing=getRadarHeadingRadians()-absolation_bearing;
double a=normalizeBearing(relative_radar_bearing);
setTurnRadarLeftRadians(a);
}
}
public double normalizeBearing( double angle )
{
if ( angle < -Math.PI )
angle += 2*Math.PI;
if ( angle > Math.PI )
angle -= 2*Math.PI;
return angle;
}
public void doFire()
{
double heading_offset=enemy.en_heading-enemy.pre_heading+0.000001;
double distance=enemy.distance;
double bullet_velocity=20-3*3;
double r=enemy.velocity/heading_offset;
double heading=0.0;
for(int i=0;i<4;i++)//迭代 使预测更加准确
{
double b_travel_ti=distance/bullet_velocity;
double predict_heading_r=enemy.en_heading+heading_offset*b_travel_ti;
double predict_x=enemy.xCoordinate-r*Math.cos(predict_heading_r)+r*Math.cos(enemy.en_heading);
double predict_y=enemy.yCoordinate+r*Math.sin(predict_heading_r)-r*Math.sin(enemy.en_heading);
heading=Math.atan2(predict_x-getX(),predict_y-getY());
double diatance=Point2D.distance( getX(), getY(), predict_x, predict_y );
}
double a=normalizeBearing(heading-getGunHeadingRadians());
setTurnGunRightRadians(a);
setFire(3);
}
public void onHitByBullet(HitByBulletEvent e)
{
if(getX()>150&&getY()>150&&enemy.battle_w-getX()>150&&enemy.battle_h-getY()>150)
{
double dist=150;
double a=normalizeBearing(90 - (getHeading() - e.getHeading()));
if(Math.abs(a)>Math.PI/2)
{
a=normalizeBearing(a+Math.PI);
}
setTurnRight( a);
setAhead(dist);
dist *= -1;
}
}
public void onWin(WinEvent e)
{
for (int i = 0; i < 50; i++)
{
turnGunRightRadians(Math.PI*3/4);
turnGunLeftRadians(Math.PI*3/4);
}
}
}
class enemyStat //方法
{ public double pre_heading;
public double en_heading;
double xCoordinate;
double yCoordinate;
double direction;
double battle_h;
double battle_w;
double relative_bearing;
double velocity;
double time;
double distance;
public void updateStat(ScannedRobotEvent e,AdvancedRobot ar)
{
pre_heading=en_heading;
en_heading=e.getHeadingRadians();
battle_h=ar.getBattleFieldHeight();
battle_w=ar.getBattleFieldWidth();
relative_bearing=e.getBearingRadians();
direction = relative_bearing + ar.getHeadingRadians();
xCoordinate= ar.getX() + Math.sin( direction ) * distance;
yCoordinate = ar.getY() + Math.cos( direction ) *distance;
velocity=e.getVelocity();
time=e.getTime();
distance=e.getDistance();
}
}

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/resources" excluding="**/_svn/**|**/.svn/**|**/.git/**|**/*.java"/> <classpathentry excluding="**/_svn/**|**/.svn/**|**/.git/**|**/*.java" kind="src" path="src/main/resources"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="src" path="/robocode.dotnet.host"/> <classpathentry kind="src" path="/robocode.dotnet.host"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.4/robocode.host-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.5/robocode.host-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.4/robocode.core-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.5/robocode.core-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/> <classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.4/robocode.repository-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.5/robocode.repository-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="src" path="/robocode.dotnet.installer"/> <classpathentry kind="src" path="/robocode.dotnet.installer"/>
<classpathentry kind="src" path="/robocode.dotnet.content"/> <classpathentry kind="src" path="/robocode.dotnet.content"/>
<classpathentry kind="src" path="/robocode.dotnet.host"/> <classpathentry kind="src" path="/robocode.dotnet.host"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.4/robocode.host-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.5/robocode.host-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.4/robocode.core-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.5/robocode.core-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/> <classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.4/robocode.repository-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.5/robocode.repository-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/> <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.4/robocode.host-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.5/robocode.host-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.4/robocode.api-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.5/robocode.api-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.4/robocode.core-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.5/robocode.core-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/> <classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.4/robocode.repository-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.5/robocode.repository-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/> <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -46,7 +46,7 @@ public class Module extends BaseModule {
} }
final String nhost = libsDir + "/robocode.dotnet.nhost-" + version + ".dll"; final String nhost = libsDir + "/robocode.dotnet.nhost-" + version + ".dll";
final String ncontrol = libsDir + "/robocode.control.dll"; final String ncontrol = libsDir + "/robocode.control.dll";bhq
Bridge.init(new File(libsDir)); Bridge.init(new File(libsDir));
// Bridge.setVerbose(true); // Bridge.setVerbose(true);

View File

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/> <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources" excluding="**/_svn/**|**/.svn/**|**/.git/**|**/*.java"/> <classpathentry excluding="**/_svn/**|**/.svn/**|**/.git/**|**/*.java" kind="src" path="src/test/resources"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.4/robocode.core-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.core/1.9.2.5/robocode.core-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.4/robocode.api-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.5/robocode.api-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/> <classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.4/robocode.host-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.host/1.9.2.5/robocode.host-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.battle/1.9.2.4/robocode.battle-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.battle/1.9.2.5/robocode.battle-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.4/robocode.repository-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.repository/1.9.2.5/robocode.repository-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.samples/1.9.2.4/robocode.samples-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.samples/1.9.2.5/robocode.samples-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests/1.9.2.4/robocode.tests-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests/1.9.2.5/robocode.tests-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests.robots/1.9.2.4/robocode.tests.robots-1.9.2.4.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests.robots/1.9.2.5/robocode.tests.robots-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/> <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<classpathentry kind="src" path="/robocode.dotnet.host"/> <classpathentry kind="src" path="/robocode.dotnet.host"/>
<classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/jni4net/jni4net.j/0.8.7.0/jni4net.j-0.8.7.0.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -40,33 +40,33 @@ public class TestMaxTurnRate extends RobocodeTestBed {
if (event.getTurnSnapshot().getTurn() == 26) { if (event.getTurnSnapshot().getTurn() == 26) {
final String out = buf.toString(); final String out = buf.toString();
Assert.assertTrue(out.contains("1: 0.0, 0.0") | out.contains("1: 0.0, -0.0")); Assert.assertTrue(out.contains("1: 0.0, 0.0") || out.contains("1: 0.0, -0.0"));
Assert.assertTrue(out.contains("2: 0.0, -1.0") | out.contains("2: 0.0, -0.999999999")); Assert.assertTrue(out.contains("2: 0.0, -1.0") || out.contains("2: 0.0, -0.999999999"));
Assert.assertTrue(out.contains("3: 0.0, -2.0") | out.contains("3: 0.0, -1.999999999")); Assert.assertTrue(out.contains("3: 0.0, -2.0") || out.contains("3: 0.0, -1.999999999"));
Assert.assertTrue(out.contains("4: 0.0, -3.0") | out.contains("4: 0.0, -2.999999999")); Assert.assertTrue(out.contains("4: 0.0, -3.0") || out.contains("4: 0.0, -2.999999999"));
Assert.assertTrue(out.contains("5: 0.0, -4.0") | out.contains("5: 0.0, -3.999999999")); Assert.assertTrue(out.contains("5: 0.0, -4.0") || out.contains("5: 0.0, -3.999999999"));
Assert.assertTrue(out.contains("6: 0.0, -5.0") | out.contains("6: 0.0, -4.999999999")); Assert.assertTrue(out.contains("6: 0.0, -5.0") || out.contains("6: 0.0, -4.999999999"));
Assert.assertTrue(out.contains("7: 0.0, -6.0") | out.contains("7: 0.0, -5.999999999")); Assert.assertTrue(out.contains("7: 0.0, -6.0") || out.contains("7: 0.0, -5.999999999"));
Assert.assertTrue(out.contains("8: 0.0, -7.0") | out.contains("8: 0.0, -6.999999999")); Assert.assertTrue(out.contains("8: 0.0, -7.0") || out.contains("8: 0.0, -6.999999999"));
Assert.assertTrue(out.contains("9: 0.0, -8.0") | out.contains("9: 0.0, -7.999999999")); Assert.assertTrue(out.contains("9: 0.0, -8.0") || out.contains("9: 0.0, -7.999999999"));
Assert.assertTrue(out.contains("10: 0.0, -9.0") | out.contains("10: 0.0, -8.999999999")); Assert.assertTrue(out.contains("10: 0.0, -9.0") || out.contains("10: 0.0, -8.999999999"));
Assert.assertTrue(out.contains("11: 0.0, -10.0") | out.contains("11: 0.0, -9.999999999")); Assert.assertTrue(out.contains("11: 0.0, -10.0") || out.contains("11: 0.0, -9.999999999"));
Assert.assertTrue(out.contains("12: 0.0, -10.0") | out.contains("12: 0.0, -9.999999999")); Assert.assertTrue(out.contains("12: 0.0, -10.0") || out.contains("12: 0.0, -9.999999999"));
Assert.assertTrue(out.contains("13: 0.0, -10.0") | out.contains("13: 0.0, -9.999999999")); Assert.assertTrue(out.contains("13: 0.0, -10.0") || out.contains("13: 0.0, -9.999999999"));
Assert.assertTrue(out.contains("14: 0.0, 0.0") | out.contains("14: 0.0, -0.0")); Assert.assertTrue(out.contains("14: 0.0, 0.0") || out.contains("14: 0.0, -0.0"));
Assert.assertTrue(out.contains("15: 0.0, 1.0") | out.contains("15: 0.0, 0.999999999")); Assert.assertTrue(out.contains("15: 0.0, 1.0") || out.contains("15: 0.0, 0.999999999"));
Assert.assertTrue(out.contains("16: 0.0, 2.0") | out.contains("16: 0.0, 1.999999999")); Assert.assertTrue(out.contains("16: 0.0, 2.0") || out.contains("16: 0.0, 1.999999999"));
Assert.assertTrue(out.contains("17: 0.0, 3.0") | out.contains("17: 0.0, 2.999999999")); Assert.assertTrue(out.contains("17: 0.0, 3.0") || out.contains("17: 0.0, 2.999999999"));
Assert.assertTrue(out.contains("18: 0.0, 4.0") | out.contains("18: 0.0, 3.999999999")); Assert.assertTrue(out.contains("18: 0.0, 4.0") || out.contains("18: 0.0, 3.999999999"));
Assert.assertTrue(out.contains("19: 0.0, 5.0") | out.contains("19: 0.0, 4.999999999")); Assert.assertTrue(out.contains("19: 0.0, 5.0") || out.contains("19: 0.0, 4.999999999"));
Assert.assertTrue(out.contains("20: 0.0, 6.0") | out.contains("20: 0.0, 5.999999999")); Assert.assertTrue(out.contains("20: 0.0, 6.0") || out.contains("20: 0.0, 5.999999999"));
Assert.assertTrue(out.contains("21: 0.0, 7.0") | out.contains("21: 0.0, 6.999999999")); Assert.assertTrue(out.contains("21: 0.0, 7.0") || out.contains("21: 0.0, 6.999999999"));
Assert.assertTrue(out.contains("22: 0.0, 8.0") | out.contains("22: 0.0, 7.999999999")); Assert.assertTrue(out.contains("22: 0.0, 8.0") || out.contains("22: 0.0, 7.999999999"));
Assert.assertTrue(out.contains("23: 0.0, 9.0") | out.contains("23: 0.0, 8.999999999")); Assert.assertTrue(out.contains("23: 0.0, 9.0") || out.contains("23: 0.0, 8.999999999"));
Assert.assertTrue(out.contains("24: 0.0, 10.0") | out.contains("24: 0.0, 9.999999999")); Assert.assertTrue(out.contains("24: 0.0, 10.0") || out.contains("24: 0.0, 9.999999999"));
Assert.assertTrue(out.contains("25: 0.0, 10.0") | out.contains("25: 0.0, 9.999999999")); Assert.assertTrue(out.contains("25: 0.0, 10.0") || out.contains("25: 0.0, 9.999999999"));
Assert.assertTrue(out.contains("26: 0.0, 10.0") | out.contains("26: 0.0, 9.999999999")); Assert.assertTrue(out.contains("26: 0.0, 10.0") || out.contains("26: 0.0, 9.999999999"));
} }
} }
} }

View File

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.0.0/robocode.api-1.9.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.5/robocode.api-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/> <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="src" path="/robocode.testing.api"/> <classpathentry kind="src" path="/robocode.testing.api"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.0.0/robocode.api-1.9.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.5/robocode.api-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/> <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<classpathentry kind="src" path="/robocode.testing.content"/> <classpathentry kind="src" path="/robocode.testing.content"/>
<classpathentry kind="src" path="/robocode.testing.samples"/> <classpathentry kind="src" path="/robocode.testing.samples"/>
<classpathentry kind="src" path="/robocode.testing.installer"/> <classpathentry kind="src" path="/robocode.testing.installer"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.0.0/robocode.api-1.9.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.api/1.9.2.5/robocode.api-1.9.2.5.jar"/>
<classpathentry kind="src" path="/robocode.testing.api"/> <classpathentry kind="src" path="/robocode.testing.api"/>
<classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/> <classpathentry kind="var" path="M2_REPO/junit/junit/4.11/junit-4.11.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/> <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests/1.9.0.0/robocode.tests-1.9.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests/1.9.2.5/robocode.tests-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests.robots/1.9.0.0/robocode.tests.robots-1.9.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.tests.robots/1.9.2.5/robocode.tests.robots-1.9.2.5.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.samples/1.9.0.0/robocode.samples-1.9.0.0.jar"/> <classpathentry kind="var" path="M2_REPO/net/sf/robocode/robocode.samples/1.9.2.5/robocode.samples-1.9.2.5.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View File

@ -2,13 +2,10 @@
<projectDescription> <projectDescription>
<name>robocode.api</name> <name>robocode.api</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects> <projects/>
</projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name> <name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>

View File

@ -7,6 +7,7 @@
<listEntry value="1"/> <listEntry value="1"/>
</listAttribute> </listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> <listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.profile"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> <listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/> <listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
</listAttribute> </listAttribute>

View File

@ -572,7 +572,18 @@ public class Robot extends _Robot implements IInteractiveRobot, IPaintRobot, IBa
return 0; // never called return 0; // never called
} }
/**
* Returns the sentry border size for a {@link robocode.BorderSentry BorderSentry} that defines the how
* far a BorderSentry is allowed to move from the border edges measured in units.<br>
* Hence, the sentry border size defines the width/range of the border area surrounding the battlefield that
* BorderSentrys cannot leave (sentry robots robots must stay in the border area), but it also define the
* distance from the border edges where BorderSentrys are allowed/able to make damage to robots entering this
* border area.
*
* @return the border size in units/pixels.
*
* @since 1.9.0.0
*/
public int getSentryBorderSize() { public int getSentryBorderSize() {
if (peer != null) { if (peer != null) {
return peer.getSentryBorderSize(); return peer.getSentryBorderSize();

View File

@ -1,3 +1,10 @@
/**
* Copyright (c) 2001-2016 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://robocode.sourceforge.net/license/epl-v10.html
*/
package robocode; package robocode;
@ -10,10 +17,43 @@ import java.io.Serializable;
import java.util.Vector; import java.util.Vector;
/**
* An advanced type of robot that supports sending messages between team
* mates in a robot team.
* <p/>
* If you have not done already, you should create a {@link Robot} or
* {@link AdvancedRobot} first.
*
* @see JuniorRobot
* @see Robot
* @see AdvancedRobot
* @see RateControlRobot
* @see Droid
* @see BorderSentry
*
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Pavel Savara (contributor)
*/
public class TeamRobot extends AdvancedRobot implements ITeamRobot, ITeamEvents { public class TeamRobot extends AdvancedRobot implements ITeamRobot, ITeamEvents {
/**
* Broadcasts a message to all teammates.
* <p/>
* Example:
* <pre>
* public void run() {
* broadcastMessage("I'm here!");
* }
* </pre>
*
* @param message the message to broadcast to all teammates
* @throws IOException if the message could not be broadcasted to the
* teammates
* @see #isTeammate(String)
* @see #getTeammates()
* @see #sendMessage(String, Serializable)
*/
public void broadcastMessage(Serializable message) throws IOException { public void broadcastMessage(Serializable message) throws IOException {
if (peer != null) { if (peer != null) {
((ITeamRobotPeer) peer).broadcastMessage(message); ((ITeamRobotPeer) peer).broadcastMessage(message);
@ -22,7 +62,23 @@ public class TeamRobot extends AdvancedRobot implements ITeamRobot, ITeamEvents
} }
} }
/**
* Returns a vector containing all MessageEvents currently in the robot's
* queue. You might, for example, call this while processing another event.
* <p/>
* Example:
* <pre>
* for (MessageEvent e : getMessageEvents()) {
* // do something with e
* }
* </pre>
*
* @return a vector containing all MessageEvents currently in the robot's
* queue
* @see #onMessageReceived(MessageEvent)
* @see MessageEvent
* @since 1.2.6
*/
public Vector<MessageEvent> getMessageEvents() { public Vector<MessageEvent> getMessageEvents() {
if (peer != null) { if (peer != null) {
return new Vector<MessageEvent>(((ITeamRobotPeer) peer).getMessageEvents()); return new Vector<MessageEvent>(((ITeamRobotPeer) peer).getMessageEvents());
@ -40,7 +96,30 @@ public class TeamRobot extends AdvancedRobot implements ITeamRobot, ITeamEvents
return this; // this robot is listening return this; // this robot is listening
} }
/**
* Returns the names of all teammates, or {@code null} there is no
* teammates.
* <p/>
* Example:
* <pre>
* public void run() {
* // Prints out all teammates
* String[] teammates = getTeammates();
* if (teammates != null) {
* for (String member : teammates) {
* out.println(member);
* }
* }
* }
* </pre>
*
* @return a String array containing the names of all your teammates, or
* {@code null} if there is no teammates. The length of the String array
* is equal to the number of teammates.
* @see #isTeammate(String)
* @see #broadcastMessage(Serializable)
* @see #sendMessage(String, Serializable)
*/
public String[] getTeammates() { public String[] getTeammates() {
if (peer != null) { if (peer != null) {
return ((ITeamRobotPeer) peer).getTeammates(); return ((ITeamRobotPeer) peer).getTeammates();
@ -49,7 +128,26 @@ public class TeamRobot extends AdvancedRobot implements ITeamRobot, ITeamEvents
return null; return null;
} }
/**
* Checks if a given robot name is the name of one of your teammates.
* <p/>
* Example:
* <pre>
* public void onScannedRobot(ScannedRobotEvent e) {
* if (isTeammate(e.getName()) {
* return;
* }
* fire(1);
* }
* </pre>
*
* @param name the robot name to check
* @return {@code true} if the specified name belongs to one of your
* teammates; {@code false} otherwise.
* @see #getTeammates()
* @see #broadcastMessage(Serializable)
* @see #sendMessage(String, Serializable)
*/
public boolean isTeammate(String name) { public boolean isTeammate(String name) {
if (peer != null) { if (peer != null) {
return ((ITeamRobotPeer) peer).isTeammate(name); return ((ITeamRobotPeer) peer).isTeammate(name);
@ -63,6 +161,23 @@ public class TeamRobot extends AdvancedRobot implements ITeamRobot, ITeamEvents
*/ */
public void onMessageReceived(MessageEvent event) {} public void onMessageReceived(MessageEvent event) {}
/**
* Sends a message to one (or more) teammates.
* <p/>
* Example:
* <pre>
* public void run() {
* sendMessage("sample.DroidBot", "I'm here!");
* }
* </pre>
*
* @param name the name of the intended recipient of the message
* @param message the message to send
* @throws IOException if the message could not be sent
* @see #isTeammate(String)
* @see #getTeammates()
* @see #broadcastMessage(Serializable)
*/
public void sendMessage(String name, Serializable message) throws IOException { public void sendMessage(String name, Serializable message) throws IOException {
if (peer != null) { if (peer != null) {
((ITeamRobotPeer) peer).sendMessage(name, message); ((ITeamRobotPeer) peer).sendMessage(name, message);

View File

@ -15,14 +15,108 @@ import java.io.Serializable;
import java.util.List; import java.util.List;
/**
* The team robot peer for team robots like {@link robocode.TeamRobot}.
* <p/>
* A robot peer is the object that deals with game mechanics and rules, and
* makes sure your robot abides by them.
*
* @see IBasicRobotPeer
* @see IStandardRobotPeer
* @see IAdvancedRobotPeer
* @see IJuniorRobotPeer
*
* @author Pavel Savara (original)
* @author Flemming N. Larsen (contributor)
*
* @since 1.6
*/
public interface ITeamRobotPeer extends IAdvancedRobotPeer { public interface ITeamRobotPeer extends IAdvancedRobotPeer {
/**
* Returns the names of all teammates, or {@code null} there is no
* teammates.
* <p/>
* Example:
* <pre>
* public void run() {
* // Prints out all teammates
* String[] teammates = getTeammates();
* if (teammates != null) {
* for (String member : teammates) {
* out.println(member);
* }
* }
* }
* </pre>
*
* @return a String array containing the names of all your teammates, or
* {@code null} if there is no teammates. The length of the String array
* is equal to the number of teammates.
* @see #isTeammate(String)
* @see #broadcastMessage(Serializable)
* @see #sendMessage(String, Serializable)
*/
String[] getTeammates(); String[] getTeammates();
/**
* Checks if a given robot name is the name of one of your teammates.
* <p/>
* Example:
* <pre>
* public void onScannedRobot(ScannedRobotEvent e) {
* if (isTeammate(e.getName()) {
* return;
* }
* fire(1);
* }
* </pre>
*
* @param name the robot name to check
* @return {@code true} if the specified name belongs to one of your
* teammates; {@code false} otherwise.
* @see #getTeammates()
* @see #broadcastMessage(Serializable)
* @see #sendMessage(String, Serializable)
*/
boolean isTeammate(String name); boolean isTeammate(String name);
/**
* Broadcasts a message to all teammates.
* <p/>
* Example:
* <pre>
* public void run() {
* broadcastMessage("I'm here!");
* }
* </pre>
*
* @param message the message to broadcast to all teammates
* @throws IOException if the message could not be broadcasted to the
* teammates
* @see #isTeammate(String)
* @see #getTeammates()
* @see #sendMessage(String, Serializable)
*/
void broadcastMessage(Serializable message) throws IOException; void broadcastMessage(Serializable message) throws IOException;
/**
* Sends a message to one (or more) teammates.
* <p/>
* Example:
* <pre>
* public void run() {
* sendMessage("sample.DroidBot", "I'm here!");
* }
* </pre>
*
* @param name the name of the intended recipient of the message
* @param message the message to send
* @throws IOException if the message could not be sent
* @see #isTeammate(String)
* @see #getTeammates()
* @see #broadcastMessage(Serializable)
*/
void sendMessage(String name, Serializable message) throws IOException; void sendMessage(String name, Serializable message) throws IOException;
/** /**

View File

@ -31,11 +31,16 @@ import robocode.control.events.RoundEndedEvent;
import robocode.control.snapshot.BulletState; import robocode.control.snapshot.BulletState;
import robocode.control.snapshot.ITurnSnapshot; import robocode.control.snapshot.ITurnSnapshot;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.*; import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
//+by Huchi
import java.io.*;
import java.net.*;
//-by Huchi
/** /**
* The {@code Battle} class is used for controlling a battle. * The {@code Battle} class is used for controlling a battle.
@ -53,6 +58,9 @@ public final class Battle extends BaseBattle {
private static final int DEBUG_TURN_WAIT_MILLIS = 10 * 60 * 1000; // 10 seconds private static final int DEBUG_TURN_WAIT_MILLIS = 10 * 60 * 1000; // 10 seconds
//by Huchi
public static Socket socket;
private final IHostManager hostManager; private final IHostManager hostManager;
private final long cpuConstant; private final long cpuConstant;
@ -94,10 +102,48 @@ public final class Battle extends BaseBattle {
battleProps.getNumRounds(), battleProps.getGunCoolingRate(), battleProps.getInactivityTime(), battleProps.getNumRounds(), battleProps.getGunCoolingRate(), battleProps.getInactivityTime(),
battleProps.getHideEnemyNames(), battleProps.getSentryBorderSize()); battleProps.getHideEnemyNames(), battleProps.getSentryBorderSize());
robotsCount = battlingRobotsList.length; robotsCount = battlingRobotsList.length;
//+by Huchi
try{
socket = new Socket("localhost",4801);
}catch(Exception e) {
System.out.println("socket initialize failed:"+e);
}
//-by Huchi
computeInitialPositions(battleProps.getInitialPositions()); computeInitialPositions(battleProps.getInitialPositions());
createPeers(battlingRobotsList); createPeers(battlingRobotsList);
} }
//by Huchi
public static void sendMsg(String toString){
try{
PrintWriter os=new PrintWriter(socket.getOutputStream());
//由Socket对象得到输出流并构造PrintWriter对象
// BufferedReader is=new BufferedReader(new InputStreamReader(socket.getInputStream()));
//由Socket对象得到输入流并构造相应的BufferedReader对象
String readline = toString;
os.println(readline);
os.flush();
System.out.println("Client:"+readline);
}catch(Exception e) {
System.out.println("Error"+e); //出错则打印出错信息
}
}
private void createPeers(RobotSpecification[] battlingRobotsList) { private void createPeers(RobotSpecification[] battlingRobotsList) {
// create teams // create teams
Map<String, Integer> countedNames = new HashMap<String, Integer>(); Map<String, Integer> countedNames = new HashMap<String, Integer>();

View File

@ -1062,6 +1062,7 @@ public final class RobotPeer implements IRobotPeerBattle, IRobotPeer {
} }
} }
private void checkWallCollision() { private void checkWallCollision() {
int minX = 0 + HALF_WIDTH_OFFSET; int minX = 0 + HALF_WIDTH_OFFSET;
int minY = 0 + HALF_HEIGHT_OFFSET; int minY = 0 + HALF_HEIGHT_OFFSET;
@ -1082,7 +1083,7 @@ public final class RobotPeer implements IRobotPeerBattle, IRobotPeer {
adjustX = maxX - x; adjustX = maxX - x;
angle = normalRelativeAngle(PI / 2 - bodyHeading); angle = normalRelativeAngle(PI / 2 - bodyHeading);
} else if (y < minY) { }else if (y < minY) {
hitWall = true; hitWall = true;
adjustY = minY - y; adjustY = minY - y;
angle = normalRelativeAngle(PI - bodyHeading); angle = normalRelativeAngle(PI - bodyHeading);
@ -1438,8 +1439,11 @@ public final class RobotPeer implements IRobotPeerBattle, IRobotPeer {
y += velocity * cos(bodyHeading); y += velocity * cos(bodyHeading);
updateBoundingBox(); updateBoundingBox();
} }
} }
private double getDistanceTraveledUntilStop(double velocity) { private double getDistanceTraveledUntilStop(double velocity) {
double distance = 0; double distance = 0;

View File

@ -108,6 +108,11 @@ public class RobocodeSecurityManager extends SecurityManager {
return; return;
} }
// Bug fix #382 Unable to run robocode.bat -- Access Control Exception
if ("SeedGenerator Thread".equals(c.getName()) && "SeedGenerator ThreadGroup".equals(cg.getName())) {
return; // The SeedGenerator might create a thread, which needs to be silently ignored
}
IHostedThread robotProxy = threadManager.getLoadedOrLoadingRobotProxy(c); IHostedThread robotProxy = threadManager.getLoadedOrLoadingRobotProxy(c);
if (robotProxy == null) { if (robotProxy == null) {

View File

@ -41,7 +41,7 @@ public class AutoExtract implements ActionListener {
int p = s.indexOf("."); int p = s.indexOf(".");
if (p >= 0) { if (p < 0) {
p = s.indexOf(".", p + 1); p = s.indexOf(".", p + 1);
} }
if (p >= 0) { if (p >= 0) {

View File

@ -201,7 +201,7 @@ public class BorderGuard extends AdvancedRobot implements BorderSentry {
if (target != null) { if (target != null) {
// Prepare colors for painting the scanned coordinate and target coordinate // Prepare colors for painting the scanned coordinate and target coordinate
color1 = new Color(0xFF, 0x7F, 0x00, 0x40); // Orange with 25% alpha blending color1 = new Color(0xFF, 0x7F, 0x00, 0x40); // Orange with 25% alpha blending
color2 = new Color(0xFF, 0x00, 0x00, 0x80); // Red with 50% alpha blending color2 = new Color(0x00, 0xFF, 0x00, 0x80); // Red with 50% alpha blending
// Paint the two circles and a line // Paint the two circles and a line
fillCircle(g, target.scannedX, target.scannedY, color1); // scanned coordinate fillCircle(g, target.scannedX, target.scannedY, color1); // scanned coordinate

View File

@ -218,8 +218,10 @@ public class RobocodeEditor extends JFrame implements Runnable, IRobocodeEditor
} }
private void createNewRobot(final String robotType) { private void createNewRobot(final String robotType) {
String message = "Enter the name of your new robot.\nExample: MyFirst" + robotType final String ROBOT_NAME_DESCRIPTION = "Enter the name of your new robot.\nExample: MyFirst" + robotType
+ "\nNote that the name cannot contain spaces."; + "\nNote that the name cannot be empty or contain spaces.";
String message = ROBOT_NAME_DESCRIPTION;
String name = ""; String name = "";
boolean done = false; boolean done = false;
@ -227,9 +229,13 @@ public class RobocodeEditor extends JFrame implements Runnable, IRobocodeEditor
while (!done) { while (!done) {
name = (String) JOptionPane.showInputDialog(this, message, "New " + robotType, JOptionPane.PLAIN_MESSAGE, name = (String) JOptionPane.showInputDialog(this, message, "New " + robotType, JOptionPane.PLAIN_MESSAGE,
null, null, name); null, null, name);
name = (name == null) ? "" : name.trim(); if (name == null) {
return; // cancelled
}
name = name.trim();
if (name.length() == 0) { if (name.length() == 0) {
return; message = ROBOT_NAME_DESCRIPTION;
continue;
} }
if (name.length() > MAX_ROBOT_NAME_LENGTH) { if (name.length() > MAX_ROBOT_NAME_LENGTH) {
name = name.substring(0, MAX_ROBOT_NAME_LENGTH); name = name.substring(0, MAX_ROBOT_NAME_LENGTH);
@ -275,22 +281,28 @@ public class RobocodeEditor extends JFrame implements Runnable, IRobocodeEditor
} }
} }
message = "Enter a short package name for your new robot and without spaces (lower-case letters are prefered).\n" final String ROBOT_PACKAGE_NAME_DESCRIPTION = "Enter a short package name for your new robot and without spaces (lower-case letters are prefered).\n"
+ "Your initials will work well here.\n" + "Your initials will work well here.\n"
+ "Your robot will be put into this package to avoid name conflict with other robots.\n" + "Your robot will be put into this package to avoid name conflict with other robots.\n"
+ "The package name is used to identify your robot(s) in the game, especially if you\n" + "The package name is used to identify your robot(s) in the game, especially if you\n"
+ "want to let your robot(s) participate in competitions like e.g. RoboRumble@Home.\n" + "want to let your robot(s) participate in competitions like e.g. RoboRumble@Home.\n"
+ "Hence, you should enter the same package name for all of your robots."; + "Hence, you should enter the same package name for all of your robots.\n"
+ "Note that the package name cannot be empty or contain spaces.";
message = ROBOT_PACKAGE_NAME_DESCRIPTION;
String packageName = ""; String packageName = "";
done = false; done = false;
while (!done) { while (!done) {
packageName = (String) JOptionPane.showInputDialog(this, message, "Package name for " + name, packageName = (String) JOptionPane.showInputDialog(this, message, "Package name for " + name,
JOptionPane.PLAIN_MESSAGE, null, null, packageName); JOptionPane.PLAIN_MESSAGE, null, null, packageName);
packageName = (packageName == null) ? "" : packageName.trim(); if (packageName == null) {
return; // cancelled
}
packageName = packageName.trim();
if (packageName.length() == 0) { if (packageName.length() == 0) {
return; message = ROBOT_PACKAGE_NAME_DESCRIPTION;
continue;
} }
if (packageName.length() > MAX_PACKAGE_NAME_LENGTH) { if (packageName.length() > MAX_PACKAGE_NAME_LENGTH) {
packageName = packageName.substring(0, MAX_PACKAGE_NAME_LENGTH); packageName = packageName.substring(0, MAX_PACKAGE_NAME_LENGTH);

View File

@ -1,15 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src/main/java"/> <classpathentry kind="src" path="src/main/java" />
<classpathentry kind="src" path="src/main/resources" excluding="**/_svn/**|**/.svn/**|**/.git/**|**/*.java"/> <classpathentry kind="src" path="src/main/resources"
<classpathentry kind="output" path="target/classes"/> excluding="**/_svn/**|**/.svn/**|**/.git/**|**/*.java" />
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="output" path="target/classes" />
<classpathentry kind="src" path="/robocode.api"/> <classpathentry kind="con"
<classpathentry kind="src" path="/robocode.core"/> path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
<classpathentry kind="var" path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar"/> <classpathentry kind="src" path="/robocode.api" />
<classpathentry kind="src" path="/robocode.battle"/> <classpathentry kind="src" path="/robocode.core" />
<classpathentry kind="src" path="/robocode.host"/> <classpathentry kind="var"
<classpathentry kind="src" path="/robocode.repository"/> path="M2_REPO/org/picocontainer/picocontainer/2.14.2/picocontainer-2.14.2.jar" />
<classpathentry kind="var" path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar"/> <classpathentry kind="src" path="/robocode.battle" />
<classpathentry kind="src" path="/robocode.sound"/> <classpathentry kind="src" path="/robocode.host" />
<classpathentry kind="src" path="/robocode.repository" />
<classpathentry kind="var"
path="M2_REPO/net/sf/robocode/codesize/1.1/codesize-1.1.jar" />
<classpathentry kind="src" path="/robocode.sound" />
</classpath> </classpath>

View File

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>robocode.ui</name> <name>robocode.ui</name>
<comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the
maven-eclipse-plugin are not supported in M2Eclipse.</comment>
<projects> <projects>
<project>robocode.api</project> <project>robocode.api</project>
<project>robocode.core</project> <project>robocode.core</project>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>robocode.ui</artifactId> <artifactId>robocode.ui</artifactId>
<name>Robocode UI</name> <name>Robocode UI</name>

View File

@ -34,7 +34,9 @@ import java.awt.event.ComponentEvent;
import java.awt.geom.*; import java.awt.geom.*;
import java.awt.image.BufferStrategy; import java.awt.image.BufferStrategy;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import static java.lang.Math.*; import static java.lang.Math.*;
import java.util.Random; import java.util.Random;
@ -104,7 +106,7 @@ public class BattleView extends Canvas {
this.windowManager = (IWindowManagerExt) windowManager; this.windowManager = (IWindowManagerExt) windowManager;
this.imageManager = imageManager; this.imageManager = imageManager;
battleField = new BattleField(800, 600); battleField = new BattleField(100, 100);
new BattleObserver(windowManager); new BattleObserver(windowManager);
@ -369,7 +371,7 @@ public class BattleView extends Canvas {
private void drawSentryBorder(Graphics2D g) { private void drawSentryBorder(Graphics2D g) {
int borderSentrySize = battleRules.getSentryBorderSize(); int borderSentrySize = battleRules.getSentryBorderSize();
g.setColor(new Color(0xff, 0x00, 0x00, 0x80)); g.setColor(new Color(0x00, 0xff, 0x00, 0x80));
g.fillRect(0, 0, borderSentrySize, battleField.getHeight()); g.fillRect(0, 0, borderSentrySize, battleField.getHeight());
g.fillRect(battleField.getWidth() - borderSentrySize, 0, borderSentrySize, battleField.getHeight()); g.fillRect(battleField.getWidth() - borderSentrySize, 0, borderSentrySize, battleField.getHeight());
g.fillRect(borderSentrySize, 0, battleField.getWidth() - 2 * borderSentrySize, borderSentrySize); g.fillRect(borderSentrySize, 0, battleField.getWidth() - 2 * borderSentrySize, borderSentrySize);
@ -382,8 +384,11 @@ public class BattleView extends Canvas {
g.setClip(null); g.setClip(null);
g.setColor(Color.RED); g.setColor(Color.BLUE);
g.drawRect(-1, -1, battleField.getWidth() + 2, battleField.getHeight() + 2); g.drawRect(-1, -1, battleField.getWidth() + 500, battleField.getHeight() + 500);
g.setColor(Color.BLUE);
g.drawRect(200, 200, 300, 300);
g.setClip(savedClip); g.setClip(savedClip);
} }

View File

@ -1,4 +1,10 @@
/**
* Copyright (c) 2001-2016 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://robocode.sourceforge.net/license/epl-v10.html
*/
package net.sf.robocode.ui.dialog; package net.sf.robocode.ui.dialog;
@ -22,7 +28,14 @@ import java.awt.event.InputEvent;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
/**
* Handles menu display and interaction for Robocode.
*
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Matthew Reeder (contributor)
* @author Luis Crespo (contributor)
*/
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class MenuBar extends JMenuBar { public class MenuBar extends JMenuBar {

View File

@ -1,4 +1,10 @@
/**
* Copyright (c) 2001-2016 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://robocode.sourceforge.net/license/epl-v10.html
*/
package net.sf.robocode.ui.dialog; package net.sf.robocode.ui.dialog;
@ -20,7 +26,11 @@ import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
/**
* @author Mathew A. Nelson (original)
* @author Matthew Reeder (contributor)
* @author Flemming N. Larsen (contributor)
*/
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class TeamCreator extends JDialog implements WizardListener { public class TeamCreator extends JDialog implements WizardListener {

View File

@ -1,4 +1,10 @@
/**
* Copyright (c) 2001-2016 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://robocode.sourceforge.net/license/epl-v10.html
*/
package net.sf.robocode.ui.dialog; package net.sf.robocode.ui.dialog;
@ -18,7 +24,11 @@ import java.net.URL;
import java.util.List; import java.util.List;
/**
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Robert D. Maupin (contributor)
*/
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class TeamCreatorOptionsPanel extends WizardPanel { public class TeamCreatorOptionsPanel extends WizardPanel {
private TeamCreator teamCreator; private TeamCreator teamCreator;
@ -305,7 +315,11 @@ public class TeamCreatorOptionsPanel extends WizardPanel {
return teamPackageLabel; return teamPackageLabel;
} }
/**
* Gets the teamPackage.
*
* @return Returns a String
*/
public String getTeamPackage() { public String getTeamPackage() {
return (teamPackage != null) ? teamPackage : "."; return (teamPackage != null) ? teamPackage : ".";
} }

View File

@ -11,125 +11,208 @@
<style> <style>
body { body {
background-color: lightgray; background-color: lightgray;
font-family:sans-serif; font-family: sans-serif;
font-size:9px; font-size: 9px;
margin-bottom:3px; margin-bottom: 3px;
} }
h2 { h2 {
font-size:11px; font-size: 11px;
margin-bottom:3px; margin-bottom: 3px;
} }
.title { .title {
font-size:10px; font-size: 10px;
} }
.contributor { .contributor {
font-weight:bold; font-weight: bold;
color:green; color: green;
} }
</style> </style>
</head> </head>
<body bgcolor="{$background-color}" leftmargin="5px" topmargin="5px" marginwidth="5px" marginheight="5px"> <body bgcolor="{$background-color}" leftmargin="5px" topmargin="5px"
<table border="0" cellpadding="0" cellspacing="0"> marginwidth="5px" marginheight="5px">
<tr> <table border="0" cellpadding="0" cellspacing="0">
<td><img src="{$robocode-icon-url}" align="middle"></td> <tr>
<td class="title"> <td><img src="{$robocode-icon-url}" align="middle"></td>
&nbsp;&nbsp;Robocode version {$robocode-version} <td class="title">&nbsp;&nbsp;Robocode version
<table cellspacing="0" cellpadding="0" border="0" width="100%"> {$robocode-version}
<tr><td><img src="{$transparent}" width="1" height="5" border="0"></td></tr> <table cellspacing="0" cellpadding="0" border="0" width="100%">
</table> <tr>
&nbsp;&nbsp;&copy; Copyright 2001-2016 Robocode contributors. All rights reserved. <td><img src="{$transparent}" width="1" height="5" border="0"></td>
</td> </tr>
</tr> </table> &nbsp;&nbsp;&copy; Copyright 2001-2016 Robocode contributors. All
</table> rights reserved.
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td><img src="{$transparent}" width="1" height="3" border="0"></td></tr> <tr>
</table> <td><img src="{$transparent}" width="1" height="3" border="0"></td>
</tr>
</table>
<strong>Original Author:</strong> <span class="contributor">Mathew A. Nelson</span>. <strong>Original Author:</strong>
&nbsp;&nbsp;&nbsp;&nbsp; <span class="contributor">Mathew A. Nelson</span>.
<strong>Original Graphics:</strong> <span class="contributor">Garett S. Hourihan</span>. &nbsp;&nbsp;&nbsp;&nbsp;
<strong>Original Graphics:</strong>
<span class="contributor">Garett S. Hourihan</span>.
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td><img src="{$transparent}" width="1" height="10" border="0"></td></tr> <tr>
</table> <td><img src="{$transparent}" width="1" height="10" border="0"></td>
</tr>
</table>
Running on <strong>Java {$java-version}</strong> by {$java-vendor}&nbsp;&nbsp;|&nbsp;&nbsp; Running on
<a href="http://www.java.com/en/download/index.jsp">Download</a>&nbsp;&nbsp;|&nbsp;&nbsp; <strong>Java {$java-version}</strong> by
<a href="http://docs.oracle.com/javase/6/docs/api/">Java 6 API documentation</a><br> {$java-vendor}&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="http://www.java.com/en/download/index.jsp">Download</a>&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="http://docs.oracle.com/javase/6/docs/api/">Java 6 API
documentation</a>
<br>
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td><img src="{$transparent}" width="1" height="10" border="0"></td></tr> <tr>
<tr><td bgcolor="black"><img src="{$transparent}" width="1" height="2" border="0"></td></tr> <td><img src="{$transparent}" width="1" height="10" border="0"></td>
<tr><td><img src="{$transparent}" width="1" height="4" border="0"></td></tr> </tr>
</table> <tr>
<td bgcolor="black"><img src="{$transparent}" width="1"
height="2" border="0"></td>
</tr>
<tr>
<td><img src="{$transparent}" width="1" height="4" border="0"></td>
</tr>
</table>
<a href="http://robocode.sourceforge.net/docs/ReadMe.html">ReadMe</a> <a href="http://robocode.sourceforge.net/docs/ReadMe.html">ReadMe</a>
&nbsp;|&nbsp; &nbsp;|&nbsp;
<a href="http://robocode.sourceforge.net/license/epl-v10.html">License</a> <a href="http://robocode.sourceforge.net/license/epl-v10.html">License</a>
&nbsp;|&nbsp; &nbsp;|&nbsp;
<a href="http://robocode.sourceforge.net/">Home Page</a> <a href="http://robocode.sourceforge.net/">Home Page</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://sourceforge.net/projects/robocode/">Project Home</a>
<a href="http://sourceforge.net/projects/robocode/">Project Home</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://github.com/robo-code/robocode/blob/master/versions.md">Versions</a>
<a href="http://github.com/robo-code/robocode/blob/master/versions.md">Versions</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://robo-code.blogspot.com/">News</a> &nbsp;|&nbsp;
<a href="http://robo-code.blogspot.com/">News</a> <a href="http://robowiki.net">RoboWiki</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://robocoderepository.com/">Robocode Repository</a>
<a href="http://robowiki.net">RoboWiki</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a
<a href="http://robocoderepository.com/">Robocode Repository</a> href="https://groups.google.com/forum/?fromgroups#!forum/robocode-developers">Robocode
&nbsp;|&nbsp; Developers</a>
<a href="https://groups.google.com/forum/?fromgroups#!forum/robocode-developers">Robocode Developers</a> <br>
<br> <a href="http://sourceforge.net/projects/robocode/files/">Download</a>
<a href="http://sourceforge.net/projects/robocode/files/">Download</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a
<a href="http://robowiki.net/w/index.php?title=Robocode/Getting_Started">Getting started</a> href="http://robowiki.net/w/index.php?title=Robocode/Getting_Started">Getting
&nbsp;|&nbsp; started</a> &nbsp;|&nbsp;
<a href="http://robocode.sourceforge.net/docs/robocode/">Java API</a> <a href="http://robocode.sourceforge.net/docs/robocode/">Java API</a>
&nbsp;|&nbsp; &nbsp;|&nbsp;
<a href="http://robocode.sourceforge.net/docs/robocode.dotnet/Index.html">.NET API</a> <a
&nbsp;|&nbsp; href="http://robocode.sourceforge.net/docs/robocode.dotnet/Index.html">.NET
<a href="http://robowiki.net/w/index.php?title=Robocode/FAQ">FAQ</a> API</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://robowiki.net/w/index.php?title=Robocode/FAQ">FAQ</a>
<a href="https://groups.google.com/forum/?fromgroups#!forum/robocode">Google Group</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="https://groups.google.com/forum/?fromgroups#!forum/robocode">Google
<a href="http://sourceforge.net/p/robocode/discussion/116459/">Help Forum</a> Group</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://sourceforge.net/p/robocode/discussion/116459/">Help
<a href="http://sourceforge.net/p/robocode/bugs/">Bug Reports</a> Forum</a> &nbsp;|&nbsp;
&nbsp;|&nbsp; <a href="http://sourceforge.net/p/robocode/bugs/">Bug Reports</a>
<a href="http://sourceforge.net/p/robocode/feature-requests/">Feature Requests</a> &nbsp;|&nbsp;
<a href="http://sourceforge.net/p/robocode/feature-requests/">Feature
Requests</a>
<h2>Main Contributors</h2> <h2>Main Contributors</h2>
<span class="contributor">Mathew A. Nelson</span>: Original developer (2001-2005)<br> <span class="contributor">Mathew A. Nelson</span>: Original developer
<span class="contributor">Flemming N. Larsen</span>: Administrator, developer, integrator, lots of features (2005-2016)<br> (2001-2005)
<span class="contributor">Pavel Savara</span>: Administrator, developer, integrator, robot interfaces, refactorings, .NET plugin (2008-2011)<br> <br>
<span class="contributor">Flemming N. Larsen</span>: Administrator,
developer, integrator, lots of features (2005-2016)
<br>
<span class="contributor">Pavel Savara</span>: Administrator,
developer, integrator, robot interfaces, refactorings, .NET plugin
(2008-2011)
<br>
<h2>Contributors</h2> <h2>Contributors</h2>
<span class="contributor">Aaron Rotenberg</span>: Robot Cache Cleaner utility<br> <span class="contributor">Aaron Rotenberg</span>: Robot Cache Cleaner
<span class="contributor">Albert Perez</span>: RoboRumble@Home client<br> utility
<span class="contributor">Alexander Schultz</span>: Reporting lots of bugs and good solutions for fixing these<br> <br>
<span class="contributor">Ascander Jr</span>: Graphics for background tiles<br> <span class="contributor">Albert Perez</span>: RoboRumble@Home client
<span class="contributor">Christian D. Schnell</span>: Codesize 1.0 utility<br> <br>
<span class="contributor">Cubic Creative</span>: Design and ideas for the JuniorRobot class<br> <span class="contributor">Alexander Schultz</span>: Reporting lots of
<span class="contributor">Dan Lynn</span>: The Robocode Repository that is the central place for storing your robots and also find other robots<br> bugs and good solutions for fixing these
<span class="contributor">Endre Palatinus</span>, <span class="contributor">Eniko Nagy</span>, <span class="contributor">Attila Csizofszki</span> and <span class="contributor">Laszlo Vigh</span>: Score percentage in results/rankings<br> <br>
<span class="contributor">Jerome Lavigne</span>: Added "Smart Battles" to MeleeRumble, developer and admin of the RoboRumble server<br> <span class="contributor">Ascander Jr</span>: Graphics for background
<span class="contributor">Joachim Hofer</span>: Fixing problem with wrong results in RoboRumble<br> tiles
<span class="contributor">Joshua Galecki</span>: Added the RateControlRobot<br> <br>
<span class="contributor">Julian Kent</span>: Nano precision timing of allowed robot time<br> <span class="contributor">Christian D. Schnell</span>: Codesize 1.0
<span class="contributor">Luis Crespo</span>: Sound engine, single-step debugging, ranking panel<br> utility
<span class="contributor">Matthew Reeder</span>: Editor enhancements, keyboard shortcuts, HyperThreading bugfixes<br> <br>
<span class="contributor">Nathaniel Troutman</span>: Fixing memory leaks<br> <span class="contributor">Cubic Creative</span>: Design and ideas for
<span class="contributor">Patrick Cupka</span>, <span class="contributor">Julian Kent</span>, <span class="contributor">Nat Pavasant</span>, and <span class="contributor">"Positive"</span>: Redesigned robot movement method<br><span class="contributor">Robert D. Maupin</span>: Optimizations with collections and improved CPU constant benchmark<br> the JuniorRobot class
<span class="contributor">Ruben Moreno Montoliu</span>: Added paths with buttons to Developement Options<br> <br>
<span class="contributor">Stefan Westen</span>: onPaint method from RobocodeSG<br> <span class="contributor">Dan Lynn</span>: The Robocode Repository that
<span class="contributor">Titus Chen</span>: Bugfixes for robot teleportation, bad wall collision detection, team ranking, replay scores and robot color flickering<br> is the central place for storing your robots and also find other robots
<span class="contributor">Tuan Anh Nguyen</span>: Interactive_v2 sample robot <br>
<span class="contributor">Endre Palatinus</span>,
<span class="contributor">Eniko Nagy</span>,
<span class="contributor">Attila Csizofszki</span> and
<span class="contributor">Laszlo Vigh</span>: Score percentage in
results/rankings
<br>
<span class="contributor">Jerome Lavigne</span>: Added "Smart Battles"
to MeleeRumble, developer and admin of the RoboRumble server
<br>
<span class="contributor">Joachim Hofer</span>: Fixing problem with
wrong results in RoboRumble
<br>
<span class="contributor">Joshua Galecki</span>: Added the
RateControlRobot
<br>
<span class="contributor">Julian Kent</span>: Nano precision timing of
allowed robot time
<br>
<span class="contributor">Luis Crespo</span>: Sound engine, single-step
debugging, ranking panel
<br>
<span class="contributor">Matthew Reeder</span>: Editor enhancements,
keyboard shortcuts, HyperThreading bugfixes
<br>
<span class="contributor">Nathaniel Troutman</span>: Fixing memory
leaks
<br>
<span class="contributor">Patrick Cupka</span>,
<span class="contributor">Julian Kent</span>,
<span class="contributor">Nat Pavasant</span>, and
<span class="contributor">"Positive"</span>: Redesigned robot movement
method
<br>
<span class="contributor">Robert D. Maupin</span>: Optimizations with
collections and improved CPU constant benchmark
<br>
<span class="contributor">Ruben Moreno Montoliu</span>: Added paths
with buttons to Developement Options
<br>
<span class="contributor">Stefan Westen</span>: onPaint method from
RobocodeSG
<br>
<span class="contributor">Titus Chen</span>: Bugfixes for robot
teleportation, bad wall collision detection, team ranking, replay
scores and robot color flickering
<br>
<span class="contributor">Tuan Anh Nguyen</span>: Interactive_v2 sample
robot
<table cellspacing="0" cellpadding="0" border="0" width="100%"> <table cellspacing="0" cellpadding="0" border="0" width="100%">
<tr><td><img src="{$transparent}" width="1" height="10" border="0"></td></tr> <tr>
</table> <td><img src="{$transparent}" width="1" height="10" border="0"></td>
</tr>
</table>
<strong>Thanks goes to every contributor as well to all users reporting bugs and suggesting new features for Robocode.</strong> <strong>Thanks goes to every contributor as well to all users
reporting bugs and suggesting new features for Robocode.</strong>
</body> </body>

View File

@ -13,8 +13,8 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
</organization> </organization>
<properties> <properties>
<project.build.sourceEncoding>cp1252</project.build.sourceEncoding> <project.build.sourceEncoding>cp1252</project.build.sourceEncoding>
<robocode.version>1.9.2.5</robocode.version> <!-- Any string, but no spaces (use '-' instead of space) --> <robocode.version>1.9.2.6-Alpha</robocode.version> <!-- Any string, but no spaces (use '-' instead of space) -->
<robocode.dotnet.version>1.9.2.5</robocode.dotnet.version> <!-- Only X.X.X.X format --> <robocode.dotnet.version>1.9.2.6</robocode.dotnet.version> <!-- Only X.X.X.X format -->
<javadoc.additionalparam/> <javadoc.additionalparam/>
</properties> </properties>
<repositories> <repositories>

View File

@ -1,3 +1,7 @@
## Version 1.9.2.6 Alpha (17-05-2016)
* [Bug-381][]: Improve feedback after entering empty package name during robot creation.
* [Bug-382][]: Unable to run robocode.bat -- Access Control Exception.
## Version 1.9.2.5 (30-Dec-2015) ## Version 1.9.2.5 (30-Dec-2015)
### Bug fixes ### Bug fixes
@ -2998,6 +3002,8 @@ Currently, there is one known issue, which will be fixed with the next Beta or i
[Bug-375]: http://sourceforge.net/p/robocode/bugs/375/ (Wrong width and height returned for .NET robots) [Bug-375]: http://sourceforge.net/p/robocode/bugs/375/ (Wrong width and height returned for .NET robots)
[Bug-378]: http://sourceforge.net/p/robocode/bugs/378/ (robocode.robocodeGL.system.GLRenderer ClassNotFoundException) [Bug-378]: http://sourceforge.net/p/robocode/bugs/378/ (robocode.robocodeGL.system.GLRenderer ClassNotFoundException)
[Bug-380]: http://sourceforge.net/p/robocode/bugs/380/ (Yet another historical bot related bug) [Bug-380]: http://sourceforge.net/p/robocode/bugs/380/ (Yet another historical bot related bug)
[Bug-381]: http://sourceforge.net/p/robocode/bugs/381/ (Improve feedback after entering empty package name during robot creation)
[Bug-382]: http://sourceforge.net/p/robocode/bugs/382/ (Unable to run robocode.bat -- Access Control Exception)
[Req-1]: http://sourceforge.net/p/robocode/feature-requests/1/ (Multiple or hyperthreading CPUs (most P4s) hangs Robocode) [Req-1]: http://sourceforge.net/p/robocode/feature-requests/1/ (Multiple or hyperthreading CPUs (most P4s) hangs Robocode)
[Req-2]: http://sourceforge.net/p/robocode/feature-requests/2/ (Keep window size of "New battle" window) [Req-2]: http://sourceforge.net/p/robocode/feature-requests/2/ (Keep window size of "New battle" window)

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
测试用例.xlsx Normal file

Binary file not shown.