mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 15:30:43 -04:00
Linting
This commit is contained in:
parent
942aa981ba
commit
7e092fdf16
@ -27,9 +27,14 @@ import kotlin.math.roundToInt
|
||||
* @property constructionQueue a list of constructions names enqueued
|
||||
*/
|
||||
class CityConstructions {
|
||||
@Transient lateinit var cityInfo: CityInfo
|
||||
@Transient private var builtBuildingObjects = ArrayList<Building>()
|
||||
@Transient val builtBuildingUniqueMap = UniqueMap()
|
||||
@Transient
|
||||
lateinit var cityInfo: CityInfo
|
||||
|
||||
@Transient
|
||||
private var builtBuildingObjects = ArrayList<Building>()
|
||||
|
||||
@Transient
|
||||
val builtBuildingUniqueMap = UniqueMap()
|
||||
|
||||
var builtBuildings = HashSet<String>()
|
||||
val inProgressConstructions = HashMap<String, Int>()
|
||||
@ -37,7 +42,9 @@ class CityConstructions {
|
||||
get() {
|
||||
if (constructionQueue.isEmpty()) return "" else return constructionQueue.first()
|
||||
}
|
||||
set(value) { if(constructionQueue.isEmpty()) constructionQueue.add(value) else constructionQueue[0]=value }
|
||||
set(value) {
|
||||
if (constructionQueue.isEmpty()) constructionQueue.add(value) else constructionQueue[0] = value
|
||||
}
|
||||
var currentConstructionIsUserSet = false
|
||||
var constructionQueue = mutableListOf<String>()
|
||||
val queueMaxSize = 10
|
||||
@ -215,8 +222,10 @@ class CityConstructions {
|
||||
|
||||
//region state changing functions
|
||||
fun setTransients() {
|
||||
builtBuildingObjects = ArrayList(builtBuildings.map { cityInfo.getRuleset().buildings[it]
|
||||
?: throw java.lang.Exception("Building $it is not found!")})
|
||||
builtBuildingObjects = ArrayList(builtBuildings.map {
|
||||
cityInfo.getRuleset().buildings[it]
|
||||
?: throw java.lang.Exception("Building $it is not found!")
|
||||
})
|
||||
updateUniques()
|
||||
}
|
||||
|
||||
@ -404,8 +413,7 @@ class CityConstructions {
|
||||
if (automatic) chooseNextConstruction()
|
||||
else constructionQueue.add("Nothing") // To prevent Construction Automation
|
||||
currentConstructionIsUserSet = false
|
||||
}
|
||||
else currentConstructionIsUserSet = true // we're just continuing the regular queue
|
||||
} else currentConstructionIsUserSet = true // we're just continuing the regular queue
|
||||
}
|
||||
|
||||
fun raisePriority(constructionQueueIndex: Int) {
|
||||
@ -423,4 +431,4 @@ class CityConstructions {
|
||||
this[idx1] = this[idx2]
|
||||
this[idx2] = tmp
|
||||
}
|
||||
} // for json parsing, we need to have a default constructor
|
||||
}
|
@ -265,6 +265,7 @@ class ConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScre
|
||||
}
|
||||
|
||||
class ConstructionButtonDTO(val construction: IConstruction, val buttonText: String, val rejectionReason: String = "")
|
||||
|
||||
private fun getConstructionButton(constructionButtonDTO: ConstructionButtonDTO): Table {
|
||||
val construction = constructionButtonDTO.construction
|
||||
val pickConstructionButton = Table()
|
||||
|
Loading…
x
Reference in New Issue
Block a user