/** * 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(); } }
public boolean moveUnit(int r, int c, Direction direction) { try { map.moveUnit(r, c, direction); return true; } catch (IllegalActionException e) { return false; } }