veloren/common/src/comp/agent.rs

34 lines
601 B
Rust
Raw Normal View History

use crate::pathfinding::WorldPath;
use specs::{Component, Entity as EcsEntity};
use specs_idvs::IDVStorage;
2019-07-29 19:54:58 +00:00
use vek::*;
#[derive(Clone, Debug)]
pub enum Agent {
Wanderer(Vec2<f32>),
Pet {
target: EcsEntity,
offset: Vec2<f32>,
},
Enemy {
bearing: Vec2<f32>,
target: Option<EcsEntity>,
},
Traveler {
path: WorldPath,
},
}
impl Agent {
pub fn enemy() -> Self {
Agent::Enemy {
bearing: Vec2::zero(),
target: None,
}
}
}
impl Component for Agent {
type Storage = IDVStorage<Self>;
}