mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +07:00
exploredTiles deprecation, step 1 - do not check exploredTiles when checking if a tile is explored (#8747)
exploredTiles continues to remain updated, to allow
This commit is contained in:
@ -186,6 +186,7 @@ class Civilization : IsPartOfGameInfoSerialization {
|
|||||||
// This is basically a way to ensure our lists are immutable.
|
// This is basically a way to ensure our lists are immutable.
|
||||||
var cities = listOf<City>()
|
var cities = listOf<City>()
|
||||||
var citiesCreated = 0
|
var citiesCreated = 0
|
||||||
|
@Deprecated("4.5.0 - in favor of Tile.exploredBy")
|
||||||
var exploredTiles = HashSet<Vector2>()
|
var exploredTiles = HashSet<Vector2>()
|
||||||
|
|
||||||
// Limit camera within explored region
|
// Limit camera within explored region
|
||||||
|
@ -243,20 +243,20 @@ open class Tile : IsPartOfGameInfoSerialization {
|
|||||||
fun isExplored(player: Civilization): Boolean {
|
fun isExplored(player: Civilization): Boolean {
|
||||||
if (UncivGame.Current.viewEntireMapForDebug || player.isSpectator())
|
if (UncivGame.Current.viewEntireMapForDebug || player.isSpectator())
|
||||||
return true
|
return true
|
||||||
return exploredBy.contains(player.civName) || player.exploredTiles.contains(position)
|
return exploredBy.contains(player.civName)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setExplored(player: Civilization, isExplored: Boolean, explorerPosition: Vector2? = null) {
|
fun setExplored(player: Civilization, isExplored: Boolean, explorerPosition: Vector2? = null) {
|
||||||
if (isExplored) {
|
if (isExplored) {
|
||||||
exploredBy.add(player.civName)
|
player.exploredTiles.add(position)
|
||||||
|
|
||||||
// Disable the undo button if a new tile has been explored
|
// Disable the undo button if a new tile has been explored
|
||||||
if (player.exploredTiles.add(position) && GUI.isWorldLoaded()) {
|
if (exploredBy.add(player.civName) && GUI.isWorldLoaded()) {
|
||||||
val worldScreen = GUI.getWorldScreen()
|
val worldScreen = GUI.getWorldScreen()
|
||||||
worldScreen.preActionGameInfo = worldScreen.gameInfo
|
worldScreen.preActionGameInfo = worldScreen.gameInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
if(player.playerType == PlayerType.Human)
|
if (player.playerType == PlayerType.Human)
|
||||||
player.exploredRegion.checkTilePosition(position, explorerPosition)
|
player.exploredRegion.checkTilePosition(position, explorerPosition)
|
||||||
} else {
|
} else {
|
||||||
exploredBy.remove(player.civName)
|
exploredBy.remove(player.civName)
|
||||||
|
Reference in New Issue
Block a user