示例#1
0
 @Override
 public void moveShip(Integer shipId, String planetName) {
   Ship ship = shipRepository.getShipByShipId(shipId);
   Game game = ship.getPlayer().getGame();
   Planet destinationPlanet = planetRepository.getPlanetByName(planetName);
   validateActionMakeSureGameIsNotFinishedYet(game);
   moveShipHandler.validateMove(ship, destinationPlanet);
   moveShipHandler.moveShip(ship, destinationPlanet);
   checkLost(game);
   gameSynchronizer.updateGame(game);
 }
示例#2
0
 @Override
 public Planet getShipLocationByShipId(int shipId) {
   Ship shipDb = shipRepository.getShipByShipId(shipId);
   return shipDb.getPlanet();
 }