mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
Linting of unused new function shouldOpenPolicyPicker() (#9969)
This commit is contained in:
parent
53748a40d7
commit
066c698117
@ -29,7 +29,7 @@ class CityFounder {
|
|||||||
city.isOriginalCapital = civInfo.citiesCreated == 0
|
city.isOriginalCapital = civInfo.citiesCreated == 0
|
||||||
if (city.isOriginalCapital) {
|
if (city.isOriginalCapital) {
|
||||||
civInfo.hasEverOwnedOriginalCapital = true
|
civInfo.hasEverOwnedOriginalCapital = true
|
||||||
// if you have some culture before the 1st city is found, you may want to adopt the 1st policy
|
// if you have some culture before the 1st city is founded, you may want to adopt the 1st policy
|
||||||
civInfo.policies.shouldOpenPolicyPicker = true
|
civInfo.policies.shouldOpenPolicyPicker = true
|
||||||
}
|
}
|
||||||
civInfo.citiesCreated++
|
civInfo.citiesCreated++
|
||||||
|
@ -31,10 +31,11 @@ class PolicyManager : IsPartOfGameInfoSerialization {
|
|||||||
internal val adoptedPolicies = HashSet<String>()
|
internal val adoptedPolicies = HashSet<String>()
|
||||||
var numberOfAdoptedPolicies = 0
|
var numberOfAdoptedPolicies = 0
|
||||||
|
|
||||||
/** Indicates whether we shoudl *check* if policy is adoptible, and if so open */
|
/** Indicates whether we should *check* if policy is adoptible, and if so open */
|
||||||
var shouldOpenPolicyPicker = false
|
var shouldOpenPolicyPicker = false
|
||||||
|
|
||||||
fun shouldOpenPolicyPicker() = shouldOpenPolicyPicker && canAdoptPolicy()
|
/** Used by NextTurnAction.PickPolicy.isChoice */
|
||||||
|
fun shouldShowPolicyPicker() = (shouldOpenPolicyPicker || freePolicies > 0) && canAdoptPolicy()
|
||||||
|
|
||||||
/** A [Map] pairing each [PolicyBranch] to its priority ([Int]). */
|
/** A [Map] pairing each [PolicyBranch] to its priority ([Int]). */
|
||||||
val priorityMap: Map<PolicyBranch, Int>
|
val priorityMap: Map<PolicyBranch, Int>
|
||||||
|
@ -54,9 +54,7 @@ enum class NextTurnAction(protected val text: String, val color: Color) {
|
|||||||
},
|
},
|
||||||
PickPolicy("Pick a policy", Color.VIOLET) {
|
PickPolicy("Pick a policy", Color.VIOLET) {
|
||||||
override fun isChoice(worldScreen: WorldScreen) =
|
override fun isChoice(worldScreen: WorldScreen) =
|
||||||
(worldScreen.viewingCiv.policies.shouldOpenPolicyPicker ||
|
worldScreen.viewingCiv.policies.shouldShowPolicyPicker()
|
||||||
worldScreen.viewingCiv.policies.freePolicies > 0)
|
|
||||||
&& worldScreen.viewingCiv.policies.canAdoptPolicy()
|
|
||||||
override fun action(worldScreen: WorldScreen) {
|
override fun action(worldScreen: WorldScreen) {
|
||||||
worldScreen.game.pushScreen(PolicyPickerScreen(worldScreen.selectedCiv, worldScreen.canChangeState))
|
worldScreen.game.pushScreen(PolicyPickerScreen(worldScreen.selectedCiv, worldScreen.canChangeState))
|
||||||
worldScreen.viewingCiv.policies.shouldOpenPolicyPicker = false
|
worldScreen.viewingCiv.policies.shouldOpenPolicyPicker = false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user