mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07: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
|
||||
if (city.isOriginalCapital) {
|
||||
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.citiesCreated++
|
||||
|
@ -31,10 +31,11 @@ class PolicyManager : IsPartOfGameInfoSerialization {
|
||||
internal val adoptedPolicies = HashSet<String>()
|
||||
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
|
||||
|
||||
fun shouldOpenPolicyPicker() = shouldOpenPolicyPicker && canAdoptPolicy()
|
||||
/** Used by NextTurnAction.PickPolicy.isChoice */
|
||||
fun shouldShowPolicyPicker() = (shouldOpenPolicyPicker || freePolicies > 0) && canAdoptPolicy()
|
||||
|
||||
/** A [Map] pairing each [PolicyBranch] to its priority ([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) {
|
||||
override fun isChoice(worldScreen: WorldScreen) =
|
||||
(worldScreen.viewingCiv.policies.shouldOpenPolicyPicker ||
|
||||
worldScreen.viewingCiv.policies.freePolicies > 0)
|
||||
&& worldScreen.viewingCiv.policies.canAdoptPolicy()
|
||||
worldScreen.viewingCiv.policies.shouldShowPolicyPicker()
|
||||
override fun action(worldScreen: WorldScreen) {
|
||||
worldScreen.game.pushScreen(PolicyPickerScreen(worldScreen.selectedCiv, worldScreen.canChangeState))
|
||||
worldScreen.viewingCiv.policies.shouldOpenPolicyPicker = false
|
||||
|
Loading…
Reference in New Issue
Block a user