pub struct Team<R: BattleRules> { /* private fields */ }
Expand description
A team is an alliance of entities.
A team represents the unit of control of a player. Teams must achieve their objectives in order to win the battle.
Implementations§
Source§impl<R: BattleRules> Team<R>
impl<R: BattleRules> Team<R>
Sourcepub fn creatures(&self) -> impl Iterator<Item = &CreatureId<R>>
pub fn creatures(&self) -> impl Iterator<Item = &CreatureId<R>>
Returns an iterator over creatures.
Sourcepub fn powers_mut(&mut self) -> impl Iterator<Item = &mut Power<R>>
pub fn powers_mut(&mut self) -> impl Iterator<Item = &mut Power<R>>
Returns a mutable iterator over powers.
Sourcepub fn power_mut(&mut self, id: &PowerId<R>) -> Option<&mut Power<R>>
pub fn power_mut(&mut self, id: &PowerId<R>) -> Option<&mut Power<R>>
Returns a mutable reference to the power with the given id.
Sourcepub fn add_power(&mut self, power: Power<R>) -> Option<Power<R>>
pub fn add_power(&mut self, power: Power<R>) -> Option<Power<R>>
Adds a new power. Replaces an existing power with the same id. Returns the replaced power, if present.
Sourcepub fn remove_power(&mut self, id: &PowerId<R>) -> Option<Power<R>>
pub fn remove_power(&mut self, id: &PowerId<R>) -> Option<Power<R>>
Removes a power. Returns the removed power, if present.
Sourcepub fn conclusion(&self) -> Option<Conclusion>
pub fn conclusion(&self) -> Option<Conclusion>
Returns the conclusion reached by this team, if any.
Sourcepub fn objectives(&self) -> &Objectives<R>
pub fn objectives(&self) -> &Objectives<R>
Returns the team’s objectives.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Team<R>where
<<R as BattleRules>::TR as TeamRules<R>>::Id: Freeze,
<<R as BattleRules>::TR as TeamRules<R>>::Objectives: Freeze,
impl<R> RefUnwindSafe for Team<R>where
<<R as BattleRules>::TR as TeamRules<R>>::Id: RefUnwindSafe,
<<R as BattleRules>::TR as TeamRules<R>>::Objectives: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: RefUnwindSafe,
<<<R as BattleRules>::TR as TeamRules<R>>::Power as Id>::Id: RefUnwindSafe,
<<R as BattleRules>::TR as TeamRules<R>>::Power: RefUnwindSafe,
impl<R> Send for Team<R>where
<<R as BattleRules>::TR as TeamRules<R>>::Objectives: Send,
<<R as BattleRules>::TR as TeamRules<R>>::Power: Send,
impl<R> Sync for Team<R>where
<<R as BattleRules>::TR as TeamRules<R>>::Id: Sync,
<<R as BattleRules>::TR as TeamRules<R>>::Objectives: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Sync,
<<<R as BattleRules>::TR as TeamRules<R>>::Power as Id>::Id: Sync,
<<R as BattleRules>::TR as TeamRules<R>>::Power: Sync,
impl<R> Unpin for Team<R>where
<<R as BattleRules>::TR as TeamRules<R>>::Id: Unpin,
<<R as BattleRules>::TR as TeamRules<R>>::Objectives: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Unpin,
<<<R as BattleRules>::TR as TeamRules<R>>::Power as Id>::Id: Unpin,
<<R as BattleRules>::TR as TeamRules<R>>::Power: Unpin,
impl<R> UnwindSafe for Team<R>where
<<R as BattleRules>::TR as TeamRules<R>>::Id: UnwindSafe,
<<R as BattleRules>::TR as TeamRules<R>>::Objectives: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: UnwindSafe,
<<<R as BattleRules>::TR as TeamRules<R>>::Power as Id>::Id: UnwindSafe,
<<R as BattleRules>::TR as TeamRules<R>>::Power: UnwindSafe,
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