use specs::{Component, FlaggedStorage, VecStorage}; use vek::*; #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] pub enum InputEvent { Jump, Attack, RequestRespawn, } #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Inputs { // Held down pub move_dir: Vec2, pub jumping: bool, pub gliding: bool, // Event based pub events: Vec, } impl Component for Inputs { type Storage = VecStorage; } #[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] pub struct Actions { pub attack_time: Option, } impl Component for Actions { type Storage = FlaggedStorage>; }