aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/champion.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/champion.rs')
-rw-r--r--src/shared/champion.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/shared/champion.rs b/src/shared/champion.rs
index ec27c62..8de12a5 100644
--- a/src/shared/champion.rs
+++ b/src/shared/champion.rs
@@ -1,3 +1,4 @@
+use crate::shared::ability::*;
use crate::shared::*;
use std::str::FromStr;
@@ -37,3 +38,18 @@ impl Stats {
}
}
}
+
+impl Champion {
+ pub fn to_ability(self, attack_key: AttackKey) -> Ability {
+ match self {
+ Champion::Meele => match attack_key {
+ AttackKey::Q => Ability::Directional(DirectionalAbility::Spear),
+ _ => Ability::Targeted(TargetedAbility::MeeleAttack),
+ },
+ Champion::Ranged => match attack_key {
+ AttackKey::Q => Ability::Directional(DirectionalAbility::Spear),
+ _ => Ability::Targeted(TargetedAbility::RangedAttack),
+ },
+ }
+ }
+}