[][src]Struct weasel::status::InflictStatus

pub struct InflictStatus<R: BattleRules> { /* fields omitted */ }

Event to inflict a status effect on a character.

A status may apply side effects upon activation and each time the creature takes an action.

Examples

use weasel::{
    battle_rules, rules::empty::*, Battle, BattleController, BattleRules, CreateCreature,
    CreateTeam, EntityId, EventKind, EventTrigger, InflictStatus, 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 status_id = 1;
InflictStatus::trigger(&mut server, EntityId::Creature(creature_id), status_id)
    .fire()
    .unwrap();
assert_eq!(
    server.battle().history().events().iter().last().unwrap().kind(),
    EventKind::InflictStatus
);

Implementations

impl<R: BattleRules> InflictStatus<R>[src]

pub fn trigger<'a, P: EventProcessor<R>>(
    processor: &'a mut P,
    entity_id: EntityId<R>,
    status_id: StatusId<R>
) -> InflictStatusTrigger<'a, R, P>
[src]

Returns a trigger for this event.

pub fn entity_id(&self) -> &EntityId<R>[src]

Returns the id of the entity target of this status.

pub fn status_id(&self) -> &StatusId<R>[src]

Returns the id of the status to be inflicted.

pub fn potency(&self) -> &Option<Potency<R>>[src]

Returns the status' potency.

Trait Implementations

impl<R: BattleRules> Clone for InflictStatus<R>[src]

impl<R: BattleRules> Debug for InflictStatus<R>[src]

impl<'de, R: BattleRules> Deserialize<'de> for InflictStatus<R> where
    EntityId<R>: Deserialize<'de>,
    StatusId<R>: Deserialize<'de>,
    Option<Potency<R>>: Deserialize<'de>, 
[src]

impl<R: BattleRules + 'static> Event<R> for InflictStatus<R>[src]

impl<R: BattleRules> Serialize for InflictStatus<R> where
    EntityId<R>: Serialize,
    StatusId<R>: Serialize,
    Option<Potency<R>>: Serialize
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for InflictStatus<R> where
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: RefUnwindSafe,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: RefUnwindSafe,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: RefUnwindSafe,
    <<R as BattleRules>::FR as FightRules<R>>::Potency: RefUnwindSafe

impl<R> Send for InflictStatus<R> where
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Send,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Send,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Send,
    <<R as BattleRules>::FR as FightRules<R>>::Potency: Send

impl<R> Sync for InflictStatus<R> where
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Sync,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Sync,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Sync,
    <<R as BattleRules>::FR as FightRules<R>>::Potency: Sync

impl<R> Unpin for InflictStatus<R> where
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Unpin,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: Unpin,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Unpin,
    <<R as BattleRules>::FR as FightRules<R>>::Potency: Unpin

impl<R> UnwindSafe for InflictStatus<R> where
    <<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: UnwindSafe,
    <<<R as BattleRules>::CR as CharacterRules<R>>::Status as Id>::Id: UnwindSafe,
    <<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: UnwindSafe,
    <<R as BattleRules>::FR as FightRules<R>>::Potency: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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