2019-10-25 01:26:32 +00:00
|
|
|
pub mod biped_large;
|
2019-10-23 02:56:45 +00:00
|
|
|
pub mod bird_medium;
|
2019-10-24 23:42:33 +00:00
|
|
|
pub mod bird_small;
|
2019-10-25 01:26:32 +00:00
|
|
|
pub mod dragon;
|
|
|
|
pub mod fish_medium;
|
2019-10-24 23:42:33 +00:00
|
|
|
pub mod fish_small;
|
2019-10-25 01:26:32 +00:00
|
|
|
pub mod humanoid;
|
|
|
|
pub mod object;
|
|
|
|
pub mod quadruped_medium;
|
|
|
|
pub mod quadruped_small;
|
2019-06-28 23:42:51 +00:00
|
|
|
|
2019-07-29 19:54:48 +00:00
|
|
|
use specs::{Component, FlaggedStorage};
|
|
|
|
use specs_idvs::IDVStorage;
|
2019-06-28 23:42:51 +00:00
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
|
|
pub enum Body {
|
|
|
|
Humanoid(humanoid::Body),
|
2019-10-25 01:26:32 +00:00
|
|
|
QuadrupedSmall(quadruped_small::Body),
|
2019-06-28 23:42:51 +00:00
|
|
|
QuadrupedMedium(quadruped_medium::Body),
|
2019-10-23 02:56:45 +00:00
|
|
|
BirdMedium(bird_medium::Body),
|
|
|
|
FishMedium(fish_medium::Body),
|
2019-10-23 04:59:05 +00:00
|
|
|
Dragon(dragon::Body),
|
2019-10-24 23:42:33 +00:00
|
|
|
BirdSmall(bird_small::Body),
|
|
|
|
FishSmall(fish_small::Body),
|
|
|
|
BipedLarge(biped_large::Body),
|
2019-07-21 12:42:45 +00:00
|
|
|
Object(object::Body),
|
2019-06-28 23:42:51 +00:00
|
|
|
}
|
2019-06-30 11:48:28 +00:00
|
|
|
|
2019-08-04 08:21:29 +00:00
|
|
|
impl Body {
|
|
|
|
pub fn is_humanoid(&self) -> bool {
|
|
|
|
match self {
|
|
|
|
Body::Humanoid(_) => true,
|
|
|
|
_ => false,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-30 11:48:28 +00:00
|
|
|
impl Component for Body {
|
2019-07-29 19:54:48 +00:00
|
|
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
2019-06-30 11:48:28 +00:00
|
|
|
}
|