[][src]Struct weasel::fight::ApplyImpact

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

An event to apply an impact on the game world.

Examples

use weasel::{
    battle_rules, rules::empty::*, ApplyImpact, Battle, BattleController, BattleRules,
    EventKind, EventTrigger, Server,
};

battle_rules! {}

let battle = Battle::builder(CustomRules::new()).build();
let mut server = Server::builder(battle).build();

let impact = ();
ApplyImpact::trigger(&mut server, impact).fire().unwrap();
assert_eq!(
    server.battle().history().events()[0].kind(),
    EventKind::ApplyImpact
);

Implementations

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

pub fn trigger<'a, P: EventProcessor<R>>(
    processor: &'a mut P,
    impact: Impact<R>
) -> ApplyImpactTrigger<'a, R, P>
[src]

Returns a trigger for this event.

pub fn impact(&self) -> &Impact<R>[src]

Returns the impact inside this event.

Trait Implementations

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

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

impl<'de, R: BattleRules> Deserialize<'de> for ApplyImpact<R> where
    Impact<R>: Deserialize<'de>, 
[src]

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

impl<R: BattleRules> Serialize for ApplyImpact<R> where
    Impact<R>: Serialize
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for ApplyImpact<R> where
    <<R as BattleRules>::FR as FightRules<R>>::Impact: RefUnwindSafe

impl<R> Send for ApplyImpact<R> where
    <<R as BattleRules>::FR as FightRules<R>>::Impact: Send

impl<R> Sync for ApplyImpact<R> where
    <<R as BattleRules>::FR as FightRules<R>>::Impact: Sync

impl<R> Unpin for ApplyImpact<R> where
    <<R as BattleRules>::FR as FightRules<R>>::Impact: Unpin

impl<R> UnwindSafe for ApplyImpact<R> where
    <<R as BattleRules>::FR as FightRules<R>>::Impact: 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>,