2019-05-17 20:47:58 +00:00
|
|
|
use specs::{Component, FlaggedStorage, VecStorage};
|
|
|
|
use vek::*;
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub enum Animation {
|
|
|
|
Idle,
|
|
|
|
Run,
|
|
|
|
Jump,
|
|
|
|
Gliding,
|
|
|
|
Attack,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
|
|
|
pub struct AnimationInfo {
|
|
|
|
pub animation: Animation,
|
|
|
|
pub time: f64,
|
|
|
|
pub changed: bool,
|
|
|
|
}
|
|
|
|
|
2019-05-26 14:04:44 +00:00
|
|
|
impl Default for AnimationInfo {
|
|
|
|
fn default() -> Self {
|
2019-05-17 20:47:58 +00:00
|
|
|
Self {
|
|
|
|
animation: Animation::Idle,
|
|
|
|
time: 0.0,
|
|
|
|
changed: true,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Component for AnimationInfo {
|
|
|
|
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
|
|
|
|
}
|