Remove wraping method for transfering tile.

This commit is contained in:
Duan Tao 2018-12-04 18:09:17 +08:00
parent 7c0179b268
commit 76ecec8511
2 changed files with 4 additions and 8 deletions

View File

@ -84,11 +84,7 @@ class CityExpansionManager {
tileInfo.owningCity=null tileInfo.owningCity=null
} }
fun AcquireOwnership(tileInfo: TileInfo){ fun takeOwnership(tileInfo: TileInfo){
takeOwnership(tileInfo)
}
private fun takeOwnership(tileInfo: TileInfo){
if(tileInfo.isCityCenter()) throw Exception("What?") if(tileInfo.isCityCenter()) throw Exception("What?")
if(tileInfo.getCity()!=null) tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo) if(tileInfo.getCity()!=null) tileInfo.getCity()!!.expansion.relinquishOwnership(tileInfo)

View File

@ -243,9 +243,9 @@ class CityScreen(internal val city: CityInfo) : CameraStageBaseScreen() {
if(tile.getOwner()!=null && tile.getOwner()!!.isPlayerCivilization() if(tile.getOwner()!=null && tile.getOwner()!!.isPlayerCivilization()
&& tile.arialDistanceTo(city.getCenterTile()) <= 3 && tile.arialDistanceTo(city.getCenterTile()) <= 3
&& tile.neighbors.any{it.getCity()==city}){ && tile.neighbors.any{it.getCity()==city}){
val transferTileButton = TextButton("Acquire".tr(),skin) val acquireTileButton = TextButton("Acquire".tr(),skin)
transferTileButton.onClick { city.expansion.AcquireOwnership(tile); game.screen = CityScreen(city); dispose() } acquireTileButton.onClick { city.expansion.takeOwnership(tile); game.screen = CityScreen(city); dispose() }
tileTable.add(transferTileButton) tileTable.add(acquireTileButton)
} }
tileTable.pack() tileTable.pack()