@@ -0,0 +1,1945 @@
+package battlecode.world;%0A%0Aimport battlecode.common.BugController;%0Aimport battlecode.common.ComponentType;%0Aimport battlecode.common.GameActionException;%0Aimport battlecode.common.GameActionExceptionType;%0Aimport battlecode.common.GameConstants;%0Aimport battlecode.common.GameObject;%0Aimport battlecode.common.MapLocation;%0Aimport battlecode.common.Mine;%0Aimport battlecode.common.MineInfo;%0Aimport battlecode.common.Robot;%0Aimport battlecode.common.RobotInfo;%0Aimport battlecode.common.RobotLevel;%0Aimport battlecode.world.signal.AttackSignal;%0A%0Aimport java.util.Iterator;%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Map;%0A%0Apublic class Bug extends Sensor implements BugController %7B%0A%0A%09InternalRobot buggedRobot;%0A%09int expiration;%0A%0A%09public Bug(ComponentType type, InternalRobot robot) %7B%0A%09%09super(type,robot);%0A%09%7D%0A%0A%09public MapLocation buggedLocation() %7B%0A%09%09if(buggedRobot==null)%0A%09%09%09return null;%0A%09%09else%0A%09%09%09return buggedRobot.getLocation();%0A%09%7D%0A%0A%09public void processEndOfTurn() %7B%0A%09%09super.processEndOfTurn();%0A%09%09if(buggedRobot!=null&&gameWorld.getCurrentRound()%3E=expiration)%0A%09%09%09buggedRobot.setBugged(null);%0A%09%7D%0A%0A%09// Called by InternalRobot when the robot gets bugged by someone else.%0A%09public void removeBug() %7B%0A%09%09buggedRobot = null;%0A%09%7D%0A%0A%09public boolean canSenseComponents(InternalRobot ir) %7B%0A%09%09return false;%0A%09%7D%0A%0A%09public boolean checkWithinRange(MapLocation loc) %7B%0A%09%09if(buggedRobot==null)%0A%09%09%09return false;%0A%09%09return buggedRobot.getLocation().distanceSquaredTo(loc)%3C=GameConstants.BUG_SENSOR_RANGE;%0A%09%7D%0A%0A%09public void attackSquare(MapLocation loc, RobotLevel height) throws GameActionException %7B%0A%09%09assertEquipped();%0A%09%09assertInactive();%0A%09%09assertNotNull(loc);%0A%09%09assertNotNull(height);%0A%09%09if(robot.getLocation().distanceSquaredTo(loc)%3Etype.range)%0A%09%09%09outOfRange();%0A%09%09activate(new AttackSignal(robot,type,loc,height));%0A%09%09InternalRobot ir = gameWorld.getRobot(loc,height);%0A%09%09if(ir!=null) %7B%0A%09%09%09if(buggedRobot!=null)%0A%09%09%09%09buggedRobot.setBugged(null);%0A%09%09%09buggedRobot=ir;%0A%09%09%7D%0A%09%7D%0A%7D%0A

add Bug class