game_features 0.1.0

Various helpful constructs for game developement. See the github repository for detailled instructions.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub struct Tiered<T> {
    pub tier: u32,
    pub element: T,
}

pub struct Leveled<T: LevelFor> {
    pub level: u32,
    pub accumulated_xp: u32,
    pub element: T,
}

// Will usually use PartialFunction.
pub trait LevelFor {
    fn level_for_xp(&self, xp: u32) -> u32;
}