[][src]Trait weasel::actor::Actor

pub trait Actor<R: BattleRules>: Character<R> {
    fn abilities<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Ability<R>> + 'a>;
fn abilities_mut<'a>(
        &'a mut self
    ) -> Box<dyn Iterator<Item = &'a mut Ability<R>> + 'a>;
fn ability(&self, id: &AbilityId<R>) -> Option<&Ability<R>>;
fn ability_mut(&mut self, id: &AbilityId<R>) -> Option<&mut Ability<R>>;
fn add_ability(&mut self, ability: Ability<R>) -> Option<Ability<R>>;
fn remove_ability(&mut self, id: &AbilityId<R>) -> Option<Ability<R>>;
fn team_id(&self) -> &TeamId<R>; }

A trait for objects which possess abilities and can act during a turn.

Required methods

fn abilities<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Ability<R>> + 'a>

Returns an iterator over abilities.

fn abilities_mut<'a>(
    &'a mut self
) -> Box<dyn Iterator<Item = &'a mut Ability<R>> + 'a>

Returns a mutable iterator over abilities.

fn ability(&self, id: &AbilityId<R>) -> Option<&Ability<R>>

Returns the ability with the given id.

fn ability_mut(&mut self, id: &AbilityId<R>) -> Option<&mut Ability<R>>

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

fn add_ability(&mut self, ability: Ability<R>) -> Option<Ability<R>>

Adds a new ability. Replaces an existing ability with the same id. Returns the replaced ability, if present.

fn remove_ability(&mut self, id: &AbilityId<R>) -> Option<Ability<R>>

Removes an ability. Returns the removed ability, if present.

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

Returns the id of the team to which this actor belongs.

Loading content...

Implementors

impl<R: BattleRules> Actor<R> for Creature<R>[src]

Loading content...