mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-15 04:14:44 +07:00
chore: Removed dead functions
This commit is contained in:
parent
8293d78ec5
commit
ee9f735e9f
@ -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
|
||||
|
@ -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.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user