Struct Team

Source
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>

Source

pub fn creatures(&self) -> impl Iterator<Item = &CreatureId<R>>

Returns an iterator over creatures.

Source

pub fn powers(&self) -> impl Iterator<Item = &Power<R>>

Returns an iterator over powers.

Source

pub fn powers_mut(&mut self) -> impl Iterator<Item = &mut Power<R>>

Returns a mutable iterator over powers.

Source

pub fn power(&self, id: &PowerId<R>) -> Option<&Power<R>>

Returns the power with the given id.

Source

pub fn power_mut(&mut self, id: &PowerId<R>) -> Option<&mut Power<R>>

Returns a mutable reference to the power with the given id.

Source

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.

Source

pub fn remove_power(&mut self, id: &PowerId<R>) -> Option<Power<R>>

Removes a power. Returns the removed power, if present.

Source

pub fn conclusion(&self) -> Option<Conclusion>

Returns the conclusion reached by this team, if any.

Source

pub fn objectives(&self) -> &Objectives<R>

Returns the team’s objectives.

Trait Implementations§

Source§

impl<R: BattleRules> Id for Team<R>

Source§

type Id = <<R as BattleRules>::TR as TeamRules<R>>::Id

Type of the id value.
Source§

fn id(&self) -> &TeamId<R>

Returns a reference to the current id.

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>

§

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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V