use specs::{Component, FlaggedStorage, NullStorage, VecStorage}; use vek::*; #[derive(Clone, Debug, Default, Serialize, Deserialize)] pub struct Respawning; #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct MoveDir(pub Vec2); #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Attacking { pub time: f32, pub applied: bool, } #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Rolling { pub time: f32, pub applied: bool, } #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Crunning { pub time: f32, pub applied: bool, } #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Cidling { pub time: f32, pub applied: bool, } #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct OnGround; #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Jumping; #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Gliding; impl Component for Respawning { type Storage = NullStorage; } impl Attacking { pub fn start() -> Self { Self { time: 0.0, applied: false, } } } impl Rolling { pub fn start() -> Self { Self { time: 0.0, applied: false, } } } impl Crunning { pub fn start() -> Self { Self { time: 0.0, applied: false, } } } impl Cidling { pub fn start() -> Self { Self { time: 0.0, applied: false, } } } impl Component for MoveDir { type Storage = VecStorage; } impl Component for Attacking { type Storage = FlaggedStorage>; } impl Component for Rolling { type Storage = FlaggedStorage>; } impl Component for Crunning { type Storage = FlaggedStorage>; } impl Component for Cidling { type Storage = FlaggedStorage>; } impl Component for OnGround { type Storage = NullStorage; } impl Component for Jumping { type Storage = NullStorage; } impl Component for Gliding { type Storage = NullStorage; }