2019-12-11 05:28:45 +00:00
|
|
|
use crate::pathfinding::WorldPath;
|
2019-07-29 19:54:48 +00:00
|
|
|
use specs::{Component, Entity as EcsEntity};
|
|
|
|
use specs_idvs::IDVStorage;
|
2019-07-29 19:54:58 +00:00
|
|
|
use vek::*;
|
2019-04-16 21:06:33 +00:00
|
|
|
|
2019-12-11 05:28:45 +00:00
|
|
|
#[derive(Clone, Debug)]
|
2019-04-16 21:06:33 +00:00
|
|
|
pub enum Agent {
|
|
|
|
Wanderer(Vec2<f32>),
|
2019-05-11 12:43:19 +00:00
|
|
|
Pet {
|
|
|
|
target: EcsEntity,
|
|
|
|
offset: Vec2<f32>,
|
|
|
|
},
|
2019-05-27 11:18:14 +00:00
|
|
|
Enemy {
|
2019-08-02 18:56:37 +00:00
|
|
|
bearing: Vec2<f32>,
|
2019-05-27 11:18:14 +00:00
|
|
|
target: Option<EcsEntity>,
|
|
|
|
},
|
2019-12-11 05:28:45 +00:00
|
|
|
Traveler {
|
|
|
|
path: WorldPath,
|
|
|
|
},
|
2019-04-16 21:06:33 +00:00
|
|
|
}
|
|
|
|
|
2019-08-02 18:56:37 +00:00
|
|
|
impl Agent {
|
|
|
|
pub fn enemy() -> Self {
|
|
|
|
Agent::Enemy {
|
|
|
|
bearing: Vec2::zero(),
|
|
|
|
target: None,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-16 21:06:33 +00:00
|
|
|
impl Component for Agent {
|
2019-07-29 19:54:48 +00:00
|
|
|
type Storage = IDVStorage<Self>;
|
2019-04-16 21:06:33 +00:00
|
|
|
}
|