Beispiel #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());
   }
 }
Beispiel #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());
   }
 }
Beispiel #3
0
 public <T extends GameObject> void killSubStep(GameObjectMap<T> goMap, Cords startCords) {
   currentTurnSteps.makeSubStep(goMap, goMap.get(startCords), startCords, null);
   goMap.kill(startCords);
 }
Beispiel #4
0
 public void endStep() {
   currentTurnSteps.endStep();
 }
Beispiel #5
0
 public void beginStep() {
   currentTurnSteps.beginStep();
 }
Beispiel #6
0
 public void newTurn() {
   pastTurns.add(currentTurnSteps.toTurn());
   // this is poor, try do some loop shit
   enemyMap.newTurn();
   shipMap.newTurn();
 }
Beispiel #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);
 }
Beispiel #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);
 }