From 833a5ed0db2e594eef4e0d92b220d16190833b85 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 3 Jul 2019 18:42:28 +0300 Subject: [PATCH] Added Air unit types --- android/build.gradle | 2 +- .../com/unciv/logic/city/PopulationManager.kt | 3 +++ .../com/unciv/models/gamebasics/unit/UnitType.kt | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 53a53a13da..de37080223 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -21,7 +21,7 @@ android { applicationId "com.unciv.app" minSdkVersion 14 targetSdkVersion 28 - versionCode 267 + versionCode 268 versionName "2.17.13" } diff --git a/core/src/com/unciv/logic/city/PopulationManager.kt b/core/src/com/unciv/logic/city/PopulationManager.kt index 2a9ec6800f..8c9d940481 100644 --- a/core/src/com/unciv/logic/city/PopulationManager.kt +++ b/core/src/com/unciv/logic/city/PopulationManager.kt @@ -70,6 +70,9 @@ class PopulationManager { } } + // todo - change tile choice according to city! + // if small city, favor production above all, ignore gold! + // if larger city, food should be worth less! internal fun autoAssignPopulation() { if(getFreePopulation()==0) return diff --git a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt index 4eb3ef6441..2cc44a0dea 100644 --- a/core/src/com/unciv/models/gamebasics/unit/UnitType.kt +++ b/core/src/com/unciv/models/gamebasics/unit/UnitType.kt @@ -9,10 +9,14 @@ enum class UnitType{ Mounted, Armor, Siege, + WaterCivilian, WaterMelee, WaterRanged, - WaterSubmarine; + WaterSubmarine, + + AirFighter, + AirBomber; fun isMelee(): Boolean { return this == Melee @@ -45,6 +49,14 @@ enum class UnitType{ } fun isWaterUnit(): Boolean { - return !isLandUnit() // if we ever get air units, this'll have to change + return this==WaterSubmarine + || this==WaterRanged + || this==WaterMelee + || this==WaterCivilian + } + + fun isAirUnit():Boolean{ + return this==AirBomber + || this==AirFighter } } \ No newline at end of file