Example #1
0
 // split into undo turn and step because this is how gameLogic calls them
 public void undo() {
   if (currentTurnSteps.atTurnStart() && pastTurns.size() != 0) {
     undoMove(pastTurns.pop());
   } else if (!currentTurnSteps.atTurnStart()) {
     undoMove(currentTurnSteps.undoStep());
   }
 }
Example #2
0
 protected void undoMove(Vector<GameObjectMove<?>> goMoves) {
   // Log.i("MapData")
   for (GameObjectMove<?> goMove : goMoves) {
     GameObjectMap<? extends GameObject> goMap = goMove.gameObjectMap;
     goMap.undoMove(goMove.getStartCords(), goMove.endCords, currentTurnSteps.atTurnStart());
   }
 }
Example #3
0
 public <T extends GameObject> void killSubStep(GameObjectMap<T> goMap, Cords startCords) {
   currentTurnSteps.makeSubStep(goMap, goMap.get(startCords), startCords, null);
   goMap.kill(startCords);
 }
Example #4
0
 public void endStep() {
   currentTurnSteps.endStep();
 }
Example #5
0
 public void beginStep() {
   currentTurnSteps.beginStep();
 }
Example #6
0
 public void newTurn() {
   pastTurns.add(currentTurnSteps.toTurn());
   // this is poor, try do some loop shit
   enemyMap.newTurn();
   shipMap.newTurn();
 }
Example #7
0
 public <T extends GameObject> void placeGameObjectSubStep(
     GameObjectMap<T> goMap, T gameObject, Cords endCords) {
   goMap.place(endCords, gameObject);
   currentTurnSteps.makeSubStep(goMap, gameObject, null, endCords);
 }
Example #8
0
 public <T extends GameObject> void makeSubStepMove(
     GameObjectMap<T> goMap, Cords startCords, Cords endCords) {
   currentTurnSteps.makeSubStep(goMap, goMap.get(startCords), startCords, endCords);
   goMap.makeMove(startCords, endCords);
 }