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;
}