pub struct Skill {
pub id: SkillId,
pub name: String,
pub description: String,
pub icon_char: char,
pub skill_type: SkillType,
pub max_rank: u32,
pub requirements: Vec<SkillRequirement>,
pub effects_per_rank: Vec<SkillEffect>,
pub cost_per_rank: Vec<SkillCost>,
pub passive_modifiers: Vec<StatModifier>,
pub tags: Vec<String>,
}Fields§
§id: SkillId§name: String§description: String§icon_char: char§skill_type: SkillType§max_rank: u32§requirements: Vec<SkillRequirement>§effects_per_rank: Vec<SkillEffect>§cost_per_rank: Vec<SkillCost>§passive_modifiers: Vec<StatModifier>Implementations§
Source§impl Skill
impl Skill
pub fn new(id: SkillId, name: impl Into<String>, skill_type: SkillType) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_icon(self, c: char) -> Self
pub fn with_max_rank(self, rank: u32) -> Self
pub fn add_requirement(self, req: SkillRequirement) -> Self
pub fn add_rank_effect(self, effect: SkillEffect) -> Self
pub fn add_rank_cost(self, cost: SkillCost) -> Self
pub fn add_passive(self, modifier: StatModifier) -> Self
pub fn add_tag(self, tag: impl Into<String>) -> Self
pub fn effect_at_rank(&self, rank: u32) -> Option<&SkillEffect>
pub fn cost_at_rank(&self, rank: u32) -> Option<&SkillCost>
pub fn cooldown_at_rank(&self, rank: u32) -> f32
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Skill
impl RefUnwindSafe for Skill
impl Send for Skill
impl Sync for Skill
impl Unpin for Skill
impl UnsafeUnpin for Skill
impl UnwindSafe for Skill
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.