Пример #1
0
 /**
  * Moves a unit from its initial position to its final position.
  *
  * @param xStart
  * @param yStart
  * @param xDest
  * @param yDest
  */
 public void moveUnit(int xStart, int yStart, int xDest, int yDest) {
   try {
     gameMap.moveUnit(xStart, yStart, xDest, yDest);
   } catch (MapException e) {
     System.out.println("Game: Error in moving unit.  This should never happen.");
     e.printStackTrace();
   }
 }
Пример #2
0
 public boolean moveUnit(int r, int c, Direction direction) {
   try {
     map.moveUnit(r, c, direction);
     return true;
   } catch (IllegalActionException e) {
     return false;
   }
 }