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