示例#1
0
 private static void processSignals() throws GameActionException {
   IdAndMapLocation newDefend = null, newMove = null;
   int clearDefend = -1;
   newDefend = Radio.getDefendLocation();
   newMove = Radio.getMoveLocation();
   clearDefend = Radio.getClearDefend();
   IdAndMapLocation newHQ = Radio.getMoveCampLocation();
   if (newHQ != null) {
     personalHQ = newHQ.location;
   }
   while (newDefend != null) {
     if (teamMemberNeedsHelp[newDefend.id] == 0) {
       defendQueue.add(newDefend.id);
       teamMemberNeedsHelp[newDefend.id] = rc.getRoundNum();
     }
     teamLocations[newDefend.id] = newDefend.location;
     newDefend = Radio.getDefendLocation();
   }
   while (newMove != null) {
     moveQueue.add(newMove.location);
     newMove = Radio.getMoveLocation();
   }
   while (clearDefend != -1) {
     teamMemberNeedsHelp[clearDefend] = 0;
     clearDefend = Radio.getClearDefend();
   }
 }
 public void setAction(int totalrounds, ActionType type) {
   actions.add(new Action(type, currentRound, totalrounds));
 }
 public void setMoving(int delay) {
   actions.add(new Action(ActionType.MOVING, currentRound, delay));
   moving = 1;
   updateDrawLoc();
 }
 public void setAttacking(MapLocation target) {
   actions.add(
       new Action(ActionType.ATTACKING, currentRound, (int) info.type.attackDelay, target));
 }