mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
39 lines
985 B
Rust
39 lines
985 B
Rust
use specs::{Component, DenseVecStorage, FlaggedStorage, HashMapStorage};
|
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)]
|
|
pub enum AbilityState {
|
|
BasicAttack,
|
|
BasicBlock,
|
|
Roll,
|
|
}
|
|
impl Default for AbilityState {
|
|
fn default() -> Self { Self::BasicAttack }
|
|
}
|
|
|
|
impl Component for AbilityState {
|
|
type Storage = DenseVecStorage<Self>;
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
|
|
pub struct AbilityPool {
|
|
pub primary: Option<AbilityState>,
|
|
pub secondary: Option<AbilityState>,
|
|
pub block: Option<AbilityState>,
|
|
pub dodge: Option<AbilityState>,
|
|
}
|
|
|
|
impl Default for AbilityPool {
|
|
fn default() -> Self {
|
|
Self {
|
|
primary: Some(AbilityState::BasicAttack),
|
|
secondary: Some(AbilityState::BasicAttack),
|
|
block: None,
|
|
dodge: Some(AbilityState::Roll),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl Component for AbilityPool {
|
|
type Storage = FlaggedStorage<Self, HashMapStorage<Self>>;
|
|
}
|