More work on switching battle data to interior mutability, instead of exterior mutability.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -45,7 +45,7 @@ pub struct MoveData {
|
||||
base_usages: u8,
|
||||
target: MoveTarget,
|
||||
priority: i8,
|
||||
secondary_effect: SecondaryEffect,
|
||||
secondary_effect: Option<SecondaryEffect>,
|
||||
flags: HashSet<StringKey>,
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ impl MoveData {
|
||||
base_usages: u8,
|
||||
target: MoveTarget,
|
||||
priority: i8,
|
||||
secondary_effect: SecondaryEffect,
|
||||
secondary_effect: Option<SecondaryEffect>,
|
||||
flags: HashSet<StringKey>,
|
||||
) -> MoveData {
|
||||
MoveData {
|
||||
@@ -102,14 +102,10 @@ impl MoveData {
|
||||
self.priority
|
||||
}
|
||||
|
||||
pub fn secondary_effect(&self) -> &SecondaryEffect {
|
||||
pub fn secondary_effect(&self) -> &Option<SecondaryEffect> {
|
||||
&self.secondary_effect
|
||||
}
|
||||
|
||||
pub fn has_secondary_effect(&self) -> bool {
|
||||
self.secondary_effect.effect_name() != &StringKey::empty()
|
||||
}
|
||||
|
||||
pub fn has_flag(&self, key: &StringKey) -> bool {
|
||||
self.flags.contains(key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user