pub struct AbilityTree {
pub name: String,
pub nodes: Vec<AbilityNode>,
pub spent_points: u32,
}Fields§
§name: String§nodes: Vec<AbilityNode>§spent_points: u32Implementations§
Source§impl AbilityTree
impl AbilityTree
pub fn new(name: impl Into<String>) -> Self
pub fn add_node( &mut self, ability: Ability, required_points: u32, prereqs: Vec<u32>, pos: (f32, f32), ) -> u32
pub fn can_unlock(&self, node_id: u32, available_points: u32) -> bool
pub fn unlock(&mut self, node_id: u32, available_points: u32) -> bool
pub fn unlocked_abilities(&self) -> Vec<&Ability>
pub fn available_nodes(&self, available_points: u32) -> Vec<u32>
Trait Implementations§
Source§impl Clone for AbilityTree
impl Clone for AbilityTree
Source§fn clone(&self) -> AbilityTree
fn clone(&self) -> AbilityTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AbilityTree
impl RefUnwindSafe for AbilityTree
impl Send for AbilityTree
impl Sync for AbilityTree
impl Unpin for AbilityTree
impl UnsafeUnpin for AbilityTree
impl UnwindSafe for AbilityTree
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.