mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
29 lines
618 B
Rust
29 lines
618 B
Rust
pub mod humanoid;
|
|
pub mod object;
|
|
pub mod quadruped;
|
|
pub mod quadruped_medium;
|
|
|
|
use specs::{Component, FlaggedStorage};
|
|
use specs_idvs::IDVStorage;
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
|
pub enum Body {
|
|
Humanoid(humanoid::Body),
|
|
Quadruped(quadruped::Body),
|
|
QuadrupedMedium(quadruped_medium::Body),
|
|
Object(object::Body),
|
|
}
|
|
|
|
impl Body {
|
|
pub fn is_humanoid(&self) -> bool {
|
|
match self {
|
|
Body::Humanoid(_) => true,
|
|
_ => false,
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Component for Body {
|
|
type Storage = FlaggedStorage<Self, IDVStorage<Self>>;
|
|
}
|