Make sure all building be built before producting science. (#1678)

This commit is contained in:
Duan Tao
2020-01-13 18:06:19 +08:00
committed by Yair Morgenstern
parent 9a426318ba
commit 72df6869a3

View File

@ -61,6 +61,7 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
addUnitTrainingBuildingChoice() addUnitTrainingBuildingChoice()
addCultureBuildingChoice() addCultureBuildingChoice()
addSpaceshipPartChoice() addSpaceshipPartChoice()
addOtherBuildingChoice()
if(!cityInfo.isPuppet) { if(!cityInfo.isPuppet) {
addWondersChoice() addWondersChoice()
@ -152,6 +153,14 @@ class ConstructionAutomation(val cityConstructions: CityConstructions){
} }
} }
private fun addOtherBuildingChoice() {
val otherBuilding = buildableNotWonders.minBy { it.cost }
if (otherBuilding != null) {
val modifier = 0.6f
addChoice(relativeCostEffectiveness, otherBuilding.name, modifier)
}
}
private fun addWondersChoice() { private fun addWondersChoice() {
if (buildableWonders.any()) { if (buildableWonders.any()) {
fun getWonderPriority(wonder: Building): Float { fun getWonderPriority(wonder: Building): Float {