use crate::path::Chaser; use specs::{Component, Entity as EcsEntity}; use specs_idvs::IDVStorage; use vek::*; #[derive(Clone, Debug)] pub enum Agent { Wanderer(Vec2), Pet { target: EcsEntity, chaser: Chaser, }, Enemy { bearing: Vec2, target: Option, }, } impl Agent { pub fn enemy() -> Self { Agent::Enemy { bearing: Vec2::zero(), target: None, } } pub fn pet(target: EcsEntity) -> Self { Agent::Pet { target, chaser: Chaser::default(), } } } impl Component for Agent { type Storage = IDVStorage; }