aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/stats.rs
blob: 749453c832e129336c824af0878a3ce7dace33b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::shared::*;

#[derive(Clone, Copy, Serialize, Deserialize, PartialEq)]
pub struct Stats {
    pub attack_range: f32,
    pub movement_speed: f32,
}

#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq)]
pub struct BaseStats(pub Stats);

#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq)]
pub struct EffectiveStats(pub Stats);

impl BaseStats {
    pub fn from_champion(champion: Champion) -> Self {
        match champion {
            Champion::Meele => BaseStats(Stats {
                attack_range: 25.,
                movement_speed: 75.,
            }),
            Champion::Ranged => BaseStats(Stats {
                attack_range: 60.,
                movement_speed: 85.,
            }),
        }
    }
}