@@ -0,0 +1,1119 @@
+package baguette;%0A%0Aimport robocode.ScannedRobotEvent;%0Aimport robocode.Robot;%0A%0Apublic class AdvancedEnemyState extends EnemyState %7B%0A%09private double x;%0A%09private double y;%0A%09%0A%09public double getX()%7B%0A%09%09return x;%0A%09%7D%0A%09%0A%09public double getY()%7B%0A%09%09return y;%0A%09%7D%0A%09%0A%09public void setX(double x)%7B%0A%09%09this.x = x;%0A%09%7D%0A%09%0A%09public void setY(double y)%7B%0A%09%09this.y = y;%0A%09%7D%0A%09%0A%09public AdvancedEnemyState()%7B%0A%09%09reset();%0A%09%7D%0A%09%0A%09public void reset()%7B%0A%09%09super.reset();%0A%09%09this.x = 0;%0A%09%09this.y = 0;%0A%09%7D%0A%09%0A%09public void update(ScannedRobotEvent e, Robot r)%7B%0A%09%09super.update(e);%0A%09%09double absBearingDeg = (r.getHeading() + e.getBearing());%0A%09%09if (absBearingDeg %3C 0) absBearingDeg += 360;%0A%09%09// 0 deg is north, so we use sin to get the x%0A%09%09this.x = r.getX() + Math.sin(Math.toRadians(absBearingDeg)) * e.getDistance();%0A%09%09// idem =%3E we use cos%0A%09%09this.y = r.getY() + Math.cos(Math.toRadians(absBearingDeg)) * e.getDistance();%0A%09%7D%0A%09%0A%09public double getFutureX(long when)%7B%0A%09%09return x + Math.sin(Math.toRadians(getHeading())) * getVelocity() * when;%0A%09%7D%0A%09%0A%09public double getFutureY(long when)%7B%0A%09%09return y + Math.cos(Math.toRadians(getHeading())) * getVelocity() * when;%0A%09%7D%0A%7D%0A

add advanced enemystate