aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/stats.rs
blob: 278a19f061672ea4f9ad2a9186c5fc903d979068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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. },
        }
    }
}