pub struct Object<R: BattleRules> { /* private fields */ }
Expand description
An object is an inanimate entity.
Objects possess a position and a set of statistics, but they can’t start a turn
nor activate abilities. They can be target of status effects.
Objects aren’t part of any team.
Trait Implementations§
Source§impl<R: BattleRules> Character<R> for Object<R>
impl<R: BattleRules> Character<R> for Object<R>
Source§fn statistics<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Statistic<R>> + 'a>
fn statistics<'a>(&'a self) -> Box<dyn Iterator<Item = &'a Statistic<R>> + 'a>
Returns an iterator over statistics.
Source§fn statistics_mut<'a>(
&'a mut self,
) -> Box<dyn Iterator<Item = &'a mut Statistic<R>> + 'a>
fn statistics_mut<'a>( &'a mut self, ) -> Box<dyn Iterator<Item = &'a mut Statistic<R>> + 'a>
Returns a mutable iterator over statistics.
Source§fn statistic(&self, id: &StatisticId<R>) -> Option<&Statistic<R>>
fn statistic(&self, id: &StatisticId<R>) -> Option<&Statistic<R>>
Returns the statistic with the given id.
Source§fn statistic_mut(&mut self, id: &StatisticId<R>) -> Option<&mut Statistic<R>>
fn statistic_mut(&mut self, id: &StatisticId<R>) -> Option<&mut Statistic<R>>
Returns a mutable reference to the statistic with the given id.
Source§fn add_statistic(&mut self, statistic: Statistic<R>) -> Option<Statistic<R>>
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.
Source§fn remove_statistic(&mut self, id: &StatisticId<R>) -> Option<Statistic<R>>
fn remove_statistic(&mut self, id: &StatisticId<R>) -> Option<Statistic<R>>
Removes a statistic.
Returns the removed statistic, if present.
Source§fn statuses<'a>(&'a self) -> Box<dyn Iterator<Item = &'a AppliedStatus<R>> + 'a>
fn statuses<'a>(&'a self) -> Box<dyn Iterator<Item = &'a AppliedStatus<R>> + 'a>
Returns an iterator over statuses.
Source§fn statuses_mut<'a>(
&'a mut self,
) -> Box<dyn Iterator<Item = &'a mut AppliedStatus<R>> + 'a>
fn statuses_mut<'a>( &'a mut self, ) -> Box<dyn Iterator<Item = &'a mut AppliedStatus<R>> + 'a>
Returns a mutable iterator over statuses.
Source§fn status(&self, id: &StatusId<R>) -> Option<&AppliedStatus<R>>
fn status(&self, id: &StatusId<R>) -> Option<&AppliedStatus<R>>
Returns the status with the given id.
Source§fn status_mut(&mut self, id: &StatusId<R>) -> Option<&mut AppliedStatus<R>>
fn status_mut(&mut self, id: &StatusId<R>) -> Option<&mut AppliedStatus<R>>
Returns a mutable reference to the status with the given id.
Source§fn add_status(&mut self, status: AppliedStatus<R>) -> Option<AppliedStatus<R>>
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.
Source§fn remove_status(&mut self, id: &StatusId<R>) -> Option<AppliedStatus<R>>
fn remove_status(&mut self, id: &StatusId<R>) -> Option<AppliedStatus<R>>
Removes a status.
Returns the removed status, if present.
Source§impl<R: BattleRules> Entity<R> for Object<R>
impl<R: BattleRules> Entity<R> for Object<R>
Auto Trait Implementations§
impl<R> Freeze for Object<R>where
<<R as BattleRules>::SR as SpaceRules<R>>::Position: Freeze,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Freeze,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Freeze,
impl<R> RefUnwindSafe for Object<R>where
<<R as BattleRules>::SR as SpaceRules<R>>::Position: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: RefUnwindSafe,
<<<R as BattleRules>::CR as CharacterRules<R>>::Statistic as Id>::Id: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::Statistic: RefUnwindSafe,
<<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: RefUnwindSafe,
impl<R> Send for Object<R>where
<<R as BattleRules>::CR as CharacterRules<R>>::Statistic: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Send,
impl<R> Sync for Object<R>where
<<R as BattleRules>::SR as SpaceRules<R>>::Position: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Sync,
<<<R as BattleRules>::CR as CharacterRules<R>>::Statistic as Id>::Id: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::Statistic: Sync,
<<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Sync,
impl<R> Unpin for Object<R>where
<<R as BattleRules>::SR as SpaceRules<R>>::Position: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Unpin,
<<<R as BattleRules>::CR as CharacterRules<R>>::Statistic as Id>::Id: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::Statistic: Unpin,
<<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: Unpin,
impl<R> UnwindSafe for Object<R>where
<<R as BattleRules>::SR as SpaceRules<R>>::Position: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: UnwindSafe,
<<<R as BattleRules>::CR as CharacterRules<R>>::Statistic as Id>::Id: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::Statistic: UnwindSafe,
<<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::Status: 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