mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-11 00:08:58 +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 {
|
override fun shouldBeDisplayed(cityConstructions: CityConstructions): Boolean {
|
||||||
val rejectionReason = getRejectionReason(construction)
|
if (cityConstructions.isBeingConstructedOrEnqueued(name))
|
||||||
|
return false
|
||||||
|
val rejectionReason = getRejectionReason(cityConstructions)
|
||||||
return rejectionReason==""
|
return rejectionReason==""
|
||||||
|| rejectionReason.startsWith("Requires")
|
|| rejectionReason.startsWith("Requires")
|
||||||
|| rejectionReason == "Wonder is being built elsewhere"
|
|| rejectionReason == "Wonder is being built elsewhere"
|
||||||
@ -232,8 +234,6 @@ class Building : NamedStats(), IConstruction{
|
|||||||
|
|
||||||
fun getRejectionReason(construction: CityConstructions):String{
|
fun getRejectionReason(construction: CityConstructions):String{
|
||||||
if (construction.isBuilt(name)) return "Already built"
|
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()
|
val cityCenter = construction.cityInfo.getCenterTile()
|
||||||
if ("Must be next to desert" in uniques
|
if ("Must be next to desert" in uniques
|
||||||
|
Reference in New Issue
Block a user