From c71366c2e0a9f0b454957feeb87b51f6b27d54bd Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Fri, 15 Mar 2024 16:07:58 +0100 Subject: feat: add champions Select champions using the `--champion` flag. Valid values are `ranged` and `meele` (default). --- src/shared/stats.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/shared/stats.rs (limited to 'src/shared/stats.rs') diff --git a/src/shared/stats.rs b/src/shared/stats.rs new file mode 100644 index 0000000..278a19f --- /dev/null +++ b/src/shared/stats.rs @@ -0,0 +1,16 @@ +use crate::shared::champion::*; +use crate::shared::*; + +#[derive(Component, Message, Clone, Serialize, Deserialize, PartialEq)] +pub struct Stats { + pub attack_range: f32, +} + +impl Stats { + pub fn from_champion(champion: Champion) -> Self { + match champion { + Champion::Meele => Stats { attack_range: 35. }, + Champion::Ranged => Stats { attack_range: 60. }, + } + } +} -- cgit v1.2.3