veloren/common/src/comp/animation.rs
timokoesters 64b00f41f4 Fix invisible chars
Former-commit-id: cbb93e0511100b9b66f9ea22451c99a69b50b19c
2019-05-26 16:04:44 +02:00

33 lines
644 B
Rust

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,
}
impl Default for AnimationInfo {
fn default() -> Self {
Self {
animation: Animation::Idle,
time: 0.0,
changed: true,
}
}
}
impl Component for AnimationInfo {
type Storage = FlaggedStorage<Self, VecStorage<Self>>;
}