Esempio n. 1
0
 private boolean makeDebugDraw() {
   if (debugTiles != null && debugTiles.size() > 0) { // for debug purposes only
     String tileId = debugTiles.remove(0);
     if (tileId.equals(DEBUG_END_OF_PACK)) {
       next(GameOverPhase.class);
       return true;
     }
     TilePack tilePack = getTilePack();
     Tile tile = tilePack.drawTile(tileId);
     if (tile == null) {
       logger.warn("Invalid debug draw id: " + tileId);
     } else {
       boolean riverActive =
           tilePack.getGroupState("river-start") == TileGroupState.ACTIVE
               || tilePack.getGroupState("river") == TileGroupState.ACTIVE;
       if (game.hasCapability(RiverCapability.class) && tile.getRiver() == null && riverActive) {
         game.getCapability(RiverCapability.class).activateNonRiverTiles();
         tilePack.setGroupState("river-start", TileGroupState.RETIRED);
         game.setCurrentTile(tile); // recovery from lake placement
       }
       nextTile(tile);
       return true;
     }
   }
   return false;
 }
Esempio n. 2
0
 static TileSymmetry forTile(Tile tile) {
   if (tile.getFlier() != null) {
     return TileSymmetry.NONE;
   }
   if (tile.getWindRose() != null) {
     return TileSymmetry.NONE;
   }
   TileSymmetry symmetry = countBaseSymmetry(tile);
   Location river = tile.getRiver();
   if (river != null) {
     if (river == Location.WE || river == Location.NS) {
       if (symmetry == TileSymmetry.S4) symmetry = TileSymmetry.S2;
     } else {
       symmetry = TileSymmetry.NONE;
     }
   }
   return symmetry;
 }