[−][src]Struct weasel::status::AlterStatuses
An event to alter the statuses of a character.
Examples
use weasel::{ battle_rules, rules::empty::*, AlterStatuses, Battle, BattleController, BattleRules, CreateCreature, CreateTeam, EntityId, EventKind, EventTrigger, Server, }; battle_rules! {} let battle = Battle::builder(CustomRules::new()).build(); let mut server = Server::builder(battle).build(); let team_id = 1; CreateTeam::trigger(&mut server, team_id).fire().unwrap(); let creature_id = 1; let position = (); CreateCreature::trigger(&mut server, creature_id, team_id, position) .fire() .unwrap(); let alteration = (); AlterStatuses::trigger(&mut server, EntityId::Creature(creature_id), alteration) .fire() .unwrap(); assert_eq!( server.battle().history().events().iter().last().unwrap().kind(), EventKind::AlterStatuses );
Implementations
impl<R: BattleRules> AlterStatuses<R>
[src]
pub fn trigger<'a, P: EventProcessor<R>>(
processor: &'a mut P,
id: EntityId<R>,
alteration: StatusesAlteration<R>
) -> AlterStatusesTrigger<'a, R, P>
[src]
processor: &'a mut P,
id: EntityId<R>,
alteration: StatusesAlteration<R>
) -> AlterStatusesTrigger<'a, R, P>
Returns a trigger for this event.
pub fn id(&self) -> &EntityId<R>
[src]
Returns the character's entity id.
pub fn alteration(&self) -> &StatusesAlteration<R>
[src]
Returns the definition of the changes to the character's statuses.
Trait Implementations
impl<R: BattleRules> Clone for AlterStatuses<R>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R: BattleRules> Debug for AlterStatuses<R>
[src]
impl<'de, R: BattleRules> Deserialize<'de> for AlterStatuses<R> where
EntityId<R>: Deserialize<'de>,
StatusesAlteration<R>: Deserialize<'de>,
[src]
EntityId<R>: Deserialize<'de>,
StatusesAlteration<R>: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<R: BattleRules + 'static> Event<R> for AlterStatuses<R>
[src]
fn verify(&self, battle: &Battle<R>) -> WeaselResult<(), R>
[src]
fn apply(&self, battle: &mut Battle<R>, _: &mut Option<EventQueue<R>>)
[src]
fn kind(&self) -> EventKind
[src]
fn box_clone(&self) -> Box<dyn Event<R> + Send>
[src]
fn as_any(&self) -> &dyn Any
[src]
fn rights<'a>(&'a self, _battle: &'a Battle<R>) -> EventRights<'a, R>
[src]
impl<R: BattleRules> Serialize for AlterStatuses<R> where
EntityId<R>: Serialize,
StatusesAlteration<R>: Serialize,
[src]
EntityId<R>: Serialize,
StatusesAlteration<R>: Serialize,
Auto Trait Implementations
impl<R> RefUnwindSafe for AlterStatuses<R> where
<<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>>::StatusesAlteration: 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>>::StatusesAlteration: RefUnwindSafe,
impl<R> Send for AlterStatuses<R> where
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::StatusesAlteration: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::StatusesAlteration: Send,
impl<R> Sync for AlterStatuses<R> where
<<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>>::StatusesAlteration: 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>>::StatusesAlteration: Sync,
impl<R> Unpin for AlterStatuses<R> where
<<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>>::StatusesAlteration: 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>>::StatusesAlteration: Unpin,
impl<R> UnwindSafe for AlterStatuses<R> where
<<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>>::StatusesAlteration: 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>>::StatusesAlteration: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,