2019-09-25 20:22:39 +00:00
|
|
|
use specs::{Component, FlaggedStorage};
|
|
|
|
use specs_idvs::IDVStorage;
|
|
|
|
use vek::*;
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct Waypoint {
|
|
|
|
pos: Vec3<f32>,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Waypoint {
|
2020-02-01 20:39:39 +00:00
|
|
|
pub fn new(pos: Vec3<f32>) -> Self { Self { pos } }
|
2019-09-25 20:22:39 +00:00
|
|
|
|
2020-02-01 20:39:39 +00:00
|
|
|
pub fn get_pos(&self) -> Vec3<f32> { self.pos }
|
2019-09-25 20:22:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for Waypoint {
|
|
|
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
|
|
|
}
|
2020-01-25 02:15:15 +00:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
|
|
|
pub struct WaypointArea(f32);
|
|
|
|
|
2020-01-25 12:27:36 +00:00
|
|
|
impl WaypointArea {
|
2020-02-01 20:39:39 +00:00
|
|
|
pub fn radius(&self) -> f32 { self.0 }
|
2020-01-25 12:27:36 +00:00
|
|
|
}
|
|
|
|
|
2020-01-25 02:15:15 +00:00
|
|
|
impl Component for WaypointArea {
|
|
|
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for WaypointArea {
|
2020-02-01 20:39:39 +00:00
|
|
|
fn default() -> Self { Self(5.0) }
|
2020-01-25 02:15:15 +00:00
|
|
|
}
|