2019-05-25 21:13:38 +00:00
|
|
|
use specs::{Component, FlaggedStorage, NullStorage, VecStorage};
|
2019-05-22 20:53:24 +00:00
|
|
|
use vek::*;
|
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
|
|
|
pub struct Respawning;
|
2019-05-22 20:53:24 +00:00
|
|
|
|
2019-06-09 19:33:20 +00:00
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct MoveDir(pub Vec2<f32>);
|
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Attacking {
|
|
|
|
pub time: f32,
|
|
|
|
pub applied: bool,
|
2019-05-22 20:53:24 +00:00
|
|
|
}
|
2019-06-09 14:20:20 +00:00
|
|
|
|
2019-06-30 02:13:34 +00:00
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Wielding {
|
|
|
|
pub time: f32,
|
|
|
|
pub applied: bool,
|
|
|
|
}
|
|
|
|
|
2019-06-11 04:08:55 +00:00
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Rolling {
|
|
|
|
pub time: f32,
|
|
|
|
pub applied: bool,
|
|
|
|
}
|
|
|
|
|
2019-06-09 19:33:20 +00:00
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct OnGround;
|
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Jumping;
|
|
|
|
|
|
|
|
#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Gliding;
|
2019-05-22 20:53:24 +00:00
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
impl Component for Respawning {
|
|
|
|
type Storage = NullStorage<Self>;
|
2019-05-22 20:53:24 +00:00
|
|
|
}
|
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
impl Attacking {
|
|
|
|
pub fn start() -> Self {
|
|
|
|
Self {
|
|
|
|
time: 0.0,
|
|
|
|
applied: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-06-09 14:20:20 +00:00
|
|
|
|
2019-06-30 02:13:34 +00:00
|
|
|
impl Wielding {
|
|
|
|
pub fn start() -> Self {
|
|
|
|
Self {
|
|
|
|
time: 0.0,
|
|
|
|
applied: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-11 04:08:55 +00:00
|
|
|
impl Rolling {
|
|
|
|
pub fn start() -> Self {
|
|
|
|
Self {
|
|
|
|
time: 0.0,
|
|
|
|
applied: false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-09 19:33:20 +00:00
|
|
|
impl Component for MoveDir {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
impl Component for Attacking {
|
2019-05-22 20:53:24 +00:00
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
|
|
|
}
|
2019-05-25 21:13:38 +00:00
|
|
|
|
2019-06-30 02:13:34 +00:00
|
|
|
impl Component for Wielding {
|
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
|
|
|
}
|
|
|
|
|
2019-06-11 04:08:55 +00:00
|
|
|
impl Component for Rolling {
|
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
|
|
|
}
|
2019-06-13 19:19:13 +00:00
|
|
|
|
2019-06-09 19:33:20 +00:00
|
|
|
impl Component for OnGround {
|
|
|
|
type Storage = NullStorage<Self>;
|
|
|
|
}
|
|
|
|
|
2019-05-25 21:13:38 +00:00
|
|
|
impl Component for Jumping {
|
|
|
|
type Storage = NullStorage<Self>;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Gliding {
|
2019-06-16 17:00:44 +00:00
|
|
|
type Storage = FlaggedStorage<Self, NullStorage<Self>>;
|
2019-05-25 21:13:38 +00:00
|
|
|
}
|