[][src]Trait weasel::character::Character

pub trait Character<R: BattleRules>: Entity<R> {
    fn statistics<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = &'a Statistic<R>> + 'a>;
fn statistics_mut<'a>(
        &'a mut self
    ) -> Box<dyn Iterator<Item = &'a mut Statistic<R>> + 'a>;
fn statistic(&self, id: &StatisticId<R>) -> Option<&Statistic<R>>;
fn statistic_mut(
        &mut self,
        id: &StatisticId<R>
    ) -> Option<&mut Statistic<R>>;
fn add_statistic(&mut self, statistic: Statistic<R>) -> Option<Statistic<R>>;
fn remove_statistic(&mut self, id: &StatisticId<R>) -> Option<Statistic<R>>;
fn statuses<'a>(
        &'a self
    ) -> Box<dyn Iterator<Item = &'a AppliedStatus<R>> + 'a>;
fn statuses_mut<'a>(
        &'a mut self
    ) -> Box<dyn Iterator<Item = &'a mut AppliedStatus<R>> + 'a>;
fn status(&self, id: &StatusId<R>) -> Option<&AppliedStatus<R>>;
fn status_mut(&mut self, id: &StatusId<R>) -> Option<&mut AppliedStatus<R>>;
fn add_status(
        &mut self,
        status: AppliedStatus<R>
    ) -> Option<AppliedStatus<R>>;
fn remove_status(&mut self, id: &StatusId<R>) -> Option<AppliedStatus<R>>; }

A trait for objects which possess statistics.

Required methods

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

Returns an iterator over statistics.

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

Returns a mutable iterator over statistics.

fn statistic(&self, id: &StatisticId<R>) -> Option<&Statistic<R>>

Returns the statistic with the given id.

fn statistic_mut(&mut self, id: &StatisticId<R>) -> Option<&mut Statistic<R>>

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

fn add_statistic(&mut self, statistic: Statistic<R>) -> Option<Statistic<R>>

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

fn remove_statistic(&mut self, id: &StatisticId<R>) -> Option<Statistic<R>>

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

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

Returns an iterator over statuses.

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

Returns a mutable iterator over statuses.

fn status(&self, id: &StatusId<R>) -> Option<&AppliedStatus<R>>

Returns the status with the given id.

fn status_mut(&mut self, id: &StatusId<R>) -> Option<&mut AppliedStatus<R>>

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

fn add_status(&mut self, status: AppliedStatus<R>) -> Option<AppliedStatus<R>>

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

fn remove_status(&mut self, id: &StatusId<R>) -> Option<AppliedStatus<R>>

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

Loading content...

Implementors

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

impl<R: BattleRules> Character<R> for Object<R>[src]

Loading content...