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