// Path: src/main/java/pl/joegreen/sergeants/simulator/TerrainType.java
// final static TerrainType TILE_FOG_OBSTACLE = new TerrainType(-4) /* Cities and Mountains show up as Obstacles in the fog of war.*/;


import java.util.Optional;
import static pl.joegreen.sergeants.simulator.TerrainType.TILE_FOG_OBSTACLE;
package pl.joegreen.sergeants.simulator;




class CityTile extends AbstractTile {

    CityTile(int tileIndex, int armySize, Optional<Integer> playerIndex) {
        super(tileIndex, armySize, playerIndex);
    }

    CityTile(int tileIndex, int armySize) {
        this(tileIndex, armySize, Optional.empty());
    }

    @Override
    public void turn() {
        if (hasOwner()) {
            armySize++;
        }
    }

    @Override
    public TerrainType getTerrainType(boolean visible) {
// Path: src/main/java/pl/joegreen/sergeants/simulator/TerrainType.java
// final static TerrainType TILE_FOG_OBSTACLE = new TerrainType(-4) /* Cities and Mountains show up as Obstacles in the fog of war.*/;


// Path: src/main/java/pl/joegreen/sergeants/simulator/CityTile.java
import java.util.Optional;
import static pl.joegreen.sergeants.simulator.TerrainType.TILE_FOG_OBSTACLE;

package pl.joegreen.sergeants.simulator;




class CityTile extends AbstractTile {

    CityTile(int tileIndex, int armySize, Optional<Integer> playerIndex) {
        super(tileIndex, armySize, playerIndex);
    }

    CityTile(int tileIndex, int armySize) {
        this(tileIndex, armySize, Optional.empty());
    }

    @Override
    public void turn() {
        if (hasOwner()) {
            armySize++;
        }
    }

    @Override
    public TerrainType getTerrainType(boolean visible) {
        return visible ? getOwnerPlayerIndex().map(TerrainType::playerOwnedTerrain).orElse(TerrainType.TILE_EMPTY) : TILE_FOG_OBSTACLE;