Ejemplo n.º 1
0
 @Override
 public void loadTileFromSnapshot(Tile tile, Element tileNode) {
   if (tileNode.hasAttribute("bridge")) {
     Location loc = Location.valueOf(tileNode.getAttribute("bridge"));
     tile.placeBridge(loc);
   }
 }
Ejemplo n.º 2
0
 public void deployBridge(Position pos, Location loc) {
   Tile tile = getBoard().get(pos);
   if (!tile.isBridgeAllowed(loc)) {
     throw new IllegalArgumentException("Cannot deploy " + loc + " bridge on " + pos);
   }
   bridgeUsed = true;
   tile.placeBridge(loc);
   game.post(new BridgeDeployedEvent(game.getActivePlayer(), pos, loc));
 }