chore: Removed dead functions

This commit is contained in:
Yair Morgenstern 2023-10-08 12:56:59 +03:00
parent 8293d78ec5
commit ee9f735e9f
2 changed files with 1 additions and 16 deletions

View File

@ -407,13 +407,6 @@ class TileMap(initialCapacity: Int = 10) : IsPartOfGameInfoSerialization {
return viewableTiles.filter { it.isVisible }.map { it.tile }
}
/** Strips all units from [TileMap]
* @return stripped [clone] of [TileMap]
*/
fun stripAllUnits(): TileMap {
return clone().apply { tileList.forEach { it.stripUnits() } }
}
/** Build a list of incompatibilities of a map with a ruleset for the new game loader
*
* Is run before setTransients, so make do without startingLocationsByNation

View File

@ -437,7 +437,6 @@ open class Tile : IsPartOfGameInfoSerialization {
val owner = getOwner() ?: return false
val unit = militaryUnit
// If tile has unit
if (unit != null) {
return when {
unit.civ == owner -> false // Own - unblocks tile;
@ -446,15 +445,12 @@ open class Tile : IsPartOfGameInfoSerialization {
}
}
// No unit -> land tile is not blocked
if (isLand)
if (isLand) // Only water tiles are blocked if empty
return false
// For water tiles need also to check neighbors:
// enemy military naval units blockade all adjacent water tiles.
for (neighbor in neighbors) {
// Check only water neighbors
if (!neighbor.isWater)
continue
@ -780,10 +776,6 @@ open class Tile : IsPartOfGameInfoSerialization {
getRoadOwner()!!.neutralRoads.add(this.position)
}
fun stripUnits() {
for (unit in this.getUnits()) removeUnit(unit)
}
/**
* Sets this tile's [resource] and, if [newResource] is a Strategic resource, [resourceAmount] fields.
*