mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-30 07:21:34 -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
|
* @property constructionQueue a list of constructions names enqueued
|
||||||
*/
|
*/
|
||||||
class CityConstructions {
|
class CityConstructions {
|
||||||
@Transient lateinit var cityInfo: CityInfo
|
@Transient
|
||||||
@Transient private var builtBuildingObjects = ArrayList<Building>()
|
lateinit var cityInfo: CityInfo
|
||||||
@Transient val builtBuildingUniqueMap = UniqueMap()
|
|
||||||
|
@Transient
|
||||||
|
private var builtBuildingObjects = ArrayList<Building>()
|
||||||
|
|
||||||
|
@Transient
|
||||||
|
val builtBuildingUniqueMap = UniqueMap()
|
||||||
|
|
||||||
var builtBuildings = HashSet<String>()
|
var builtBuildings = HashSet<String>()
|
||||||
val inProgressConstructions = HashMap<String, Int>()
|
val inProgressConstructions = HashMap<String, Int>()
|
||||||
@ -37,7 +42,9 @@ class CityConstructions {
|
|||||||
get() {
|
get() {
|
||||||
if (constructionQueue.isEmpty()) return "" else return constructionQueue.first()
|
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 currentConstructionIsUserSet = false
|
||||||
var constructionQueue = mutableListOf<String>()
|
var constructionQueue = mutableListOf<String>()
|
||||||
val queueMaxSize = 10
|
val queueMaxSize = 10
|
||||||
@ -215,8 +222,10 @@ class CityConstructions {
|
|||||||
|
|
||||||
//region state changing functions
|
//region state changing functions
|
||||||
fun setTransients() {
|
fun setTransients() {
|
||||||
builtBuildingObjects = ArrayList(builtBuildings.map { cityInfo.getRuleset().buildings[it]
|
builtBuildingObjects = ArrayList(builtBuildings.map {
|
||||||
?: throw java.lang.Exception("Building $it is not found!")})
|
cityInfo.getRuleset().buildings[it]
|
||||||
|
?: throw java.lang.Exception("Building $it is not found!")
|
||||||
|
})
|
||||||
updateUniques()
|
updateUniques()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,8 +413,7 @@ class CityConstructions {
|
|||||||
if (automatic) chooseNextConstruction()
|
if (automatic) chooseNextConstruction()
|
||||||
else constructionQueue.add("Nothing") // To prevent Construction Automation
|
else constructionQueue.add("Nothing") // To prevent Construction Automation
|
||||||
currentConstructionIsUserSet = false
|
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) {
|
fun raisePriority(constructionQueueIndex: Int) {
|
||||||
@ -423,4 +431,4 @@ class CityConstructions {
|
|||||||
this[idx1] = this[idx2]
|
this[idx1] = this[idx2]
|
||||||
this[idx2] = tmp
|
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 = "")
|
class ConstructionButtonDTO(val construction: IConstruction, val buttonText: String, val rejectionReason: String = "")
|
||||||
|
|
||||||
private fun getConstructionButton(constructionButtonDTO: ConstructionButtonDTO): Table {
|
private fun getConstructionButton(constructionButtonDTO: ConstructionButtonDTO): Table {
|
||||||
val construction = constructionButtonDTO.construction
|
val construction = constructionButtonDTO.construction
|
||||||
val pickConstructionButton = Table()
|
val pickConstructionButton = Table()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user