Makes saving throw proficiencies and advantages use enums instead of raw strings.
This commit is contained in:
@@ -323,18 +323,18 @@ struct EditMonster: View {
|
|||||||
monsterIntelligenceScore = monster.intelligenceScore
|
monsterIntelligenceScore = monster.intelligenceScore
|
||||||
monsterWisdomScore = monster.wisdomScore
|
monsterWisdomScore = monster.wisdomScore
|
||||||
monsterCharismaScore = monster.charismaScore
|
monsterCharismaScore = monster.charismaScore
|
||||||
monsterStrengthSavingThrowProficiency = ProficiencyType.init(rawValue: monster.strengthSavingThrowProficiency ?? "") ?? .none
|
monsterStrengthSavingThrowProficiency = monster.strengthSavingThrowProficiencyEnum
|
||||||
monsterStrengthSavingThrowAdvantage = AdvantageType(rawValue: monster.strengthSavingThrowAdvantage ?? "") ?? .none
|
monsterStrengthSavingThrowAdvantage = monster.strengthSavingThrowAdvantageEnum
|
||||||
monsterDexteritySavingThrowProficiency = ProficiencyType(rawValue: monster.dexteritySavingThrowProficiency ?? "") ?? .none
|
monsterDexteritySavingThrowProficiency = monster.dexteritySavingThrowProficiencyEnum
|
||||||
monsterDexteritySavingThrowAdvantage = AdvantageType(rawValue: monster.dexteritySavingThrowAdvantage ?? "") ?? .none
|
monsterDexteritySavingThrowAdvantage = monster.dexteritySavingThrowAdvantageEnum
|
||||||
monsterConstitutionSavingThrowProficiency = ProficiencyType(rawValue: monster.constitutionSavingThrowProficiency ?? "") ?? .none
|
monsterConstitutionSavingThrowProficiency = monster.constitutionSavingThrowProficiencyEnum
|
||||||
monsterConstitutionSavingThrowAdvantage = AdvantageType(rawValue: monster.constitutionSavingThrowAdvantage ?? "") ?? .none
|
monsterConstitutionSavingThrowAdvantage = monster.constitutionSavingThrowAdvantageEnum
|
||||||
monsterIntelligenceSavingThrowProficiency = ProficiencyType(rawValue: monster.intelligenceSavingThrowProficiency ?? "") ?? .none
|
monsterIntelligenceSavingThrowProficiency = monster.intelligenceSavingThrowProficiencyEnum
|
||||||
monsterIntelligenceSavingThrowAdvantage = AdvantageType(rawValue: monster.intelligenceSavingThrowAdvantage ?? "") ?? .none
|
monsterIntelligenceSavingThrowAdvantage = monster.intelligenceSavingThrowAdvantageEnum
|
||||||
monsterWisdomSavingThrowProficiency = ProficiencyType(rawValue: monster.wisdomSavingThrowProficiency ?? "") ?? .none
|
monsterWisdomSavingThrowProficiency = monster.wisdomSavingThrowProficiencyEnum
|
||||||
monsterWisdomSavingThrowAdvantage = AdvantageType(rawValue: monster.wisdomSavingThrowAdvantage ?? "") ?? .none
|
monsterWisdomSavingThrowAdvantage = monster.wisdomSavingThrowAdvantageEnum
|
||||||
monsterCharismaSavingThrowProficiency = ProficiencyType(rawValue: monster.charismaSavingThrowProficiency ?? "") ?? .none
|
monsterCharismaSavingThrowProficiency = monster.charismaSavingThrowProficiencyEnum
|
||||||
monsterCharismaSavingThrowAdvantage = AdvantageType(rawValue: monster.charismaSavingThrowAdvantage ?? "") ?? .none
|
monsterCharismaSavingThrowAdvantage = monster.charismaSavingThrowAdvantageEnum
|
||||||
}
|
}
|
||||||
|
|
||||||
private func copyLocalToMonster() {
|
private func copyLocalToMonster() {
|
||||||
@@ -364,18 +364,18 @@ struct EditMonster: View {
|
|||||||
monster.intelligenceScore = monsterIntelligenceScore
|
monster.intelligenceScore = monsterIntelligenceScore
|
||||||
monster.wisdomScore = monsterWisdomScore
|
monster.wisdomScore = monsterWisdomScore
|
||||||
monster.charismaScore = monsterCharismaScore
|
monster.charismaScore = monsterCharismaScore
|
||||||
monster.strengthSavingThrowProficiency = monsterStrengthSavingThrowProficiency.rawValue
|
monster.strengthSavingThrowProficiencyEnum = monsterStrengthSavingThrowProficiency
|
||||||
monster.strengthSavingThrowAdvantage = monsterStrengthSavingThrowAdvantage.rawValue
|
monster.strengthSavingThrowAdvantageEnum = monsterStrengthSavingThrowAdvantage
|
||||||
monster.dexteritySavingThrowProficiency = monsterDexteritySavingThrowProficiency.rawValue
|
monster.dexteritySavingThrowProficiencyEnum = monsterDexteritySavingThrowProficiency
|
||||||
monster.dexteritySavingThrowAdvantage = monsterDexteritySavingThrowAdvantage.rawValue
|
monster.dexteritySavingThrowAdvantageEnum = monsterDexteritySavingThrowAdvantage
|
||||||
monster.constitutionSavingThrowProficiency = monsterConstitutionSavingThrowProficiency.rawValue
|
monster.constitutionSavingThrowProficiencyEnum = monsterConstitutionSavingThrowProficiency
|
||||||
monster.constitutionSavingThrowAdvantage = monsterConstitutionSavingThrowAdvantage.rawValue
|
monster.constitutionSavingThrowAdvantageEnum = monsterConstitutionSavingThrowAdvantage
|
||||||
monster.intelligenceSavingThrowProficiency = monsterIntelligenceSavingThrowProficiency.rawValue
|
monster.intelligenceSavingThrowProficiencyEnum = monsterIntelligenceSavingThrowProficiency
|
||||||
monster.intelligenceSavingThrowAdvantage = monsterIntelligenceSavingThrowAdvantage.rawValue
|
monster.intelligenceSavingThrowAdvantageEnum = monsterIntelligenceSavingThrowAdvantage
|
||||||
monster.wisdomSavingThrowProficiency = monsterWisdomSavingThrowProficiency.rawValue
|
monster.wisdomSavingThrowProficiencyEnum = monsterWisdomSavingThrowProficiency
|
||||||
monster.wisdomSavingThrowAdvantage = monsterWisdomSavingThrowAdvantage.rawValue
|
monster.wisdomSavingThrowAdvantageEnum = monsterWisdomSavingThrowAdvantage
|
||||||
monster.charismaSavingThrowProficiency = monsterCharismaSavingThrowProficiency.rawValue
|
monster.charismaSavingThrowProficiencyEnum = monsterCharismaSavingThrowProficiency
|
||||||
monster.charismaSavingThrowAdvantage = monsterCharismaSavingThrowAdvantage.rawValue
|
monster.charismaSavingThrowAdvantageEnum = monsterCharismaSavingThrowAdvantage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user