2019-04-16 21:06:33 +00:00
|
|
|
use specs::{Component, VecStorage};
|
|
|
|
use vek::*;
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
|
|
|
pub enum Agent {
|
|
|
|
Wanderer(Vec2<f32>),
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Agent {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
|
|
|
pub struct Control {
|
|
|
|
pub move_dir: Vec2<f32>,
|
2019-05-01 16:55:29 +00:00
|
|
|
pub jumping: bool,
|
2019-04-16 21:06:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for Control {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
move_dir: Vec2::zero(),
|
2019-05-01 16:55:29 +00:00
|
|
|
jumping: false,
|
2019-04-16 21:06:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Control {
|
|
|
|
type Storage = VecStorage<Self>;
|
|
|
|
}
|