mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 07:18:57 +07:00
Allow to buy buildings from the queue (#2032)
* Allow to buy buildings from the queue * Minor refactoring
This commit is contained in:
@ -223,8 +223,10 @@ class Building : NamedStats(), IConstruction{
|
||||
}
|
||||
|
||||
|
||||
override fun shouldBeDisplayed(construction: CityConstructions): Boolean {
|
||||
val rejectionReason = getRejectionReason(construction)
|
||||
override fun shouldBeDisplayed(cityConstructions: CityConstructions): Boolean {
|
||||
if (cityConstructions.isBeingConstructedOrEnqueued(name))
|
||||
return false
|
||||
val rejectionReason = getRejectionReason(cityConstructions)
|
||||
return rejectionReason==""
|
||||
|| rejectionReason.startsWith("Requires")
|
||||
|| rejectionReason == "Wonder is being built elsewhere"
|
||||
@ -232,8 +234,6 @@ class Building : NamedStats(), IConstruction{
|
||||
|
||||
fun getRejectionReason(construction: CityConstructions):String{
|
||||
if (construction.isBuilt(name)) return "Already built"
|
||||
if (construction.isBeingConstructed(name)) return "Is being built"
|
||||
if (construction.isEnqueued(name)) return "Already enqueued"
|
||||
|
||||
val cityCenter = construction.cityInfo.getCenterTile()
|
||||
if ("Must be next to desert" in uniques
|
||||
|
Reference in New Issue
Block a user