[][src]Struct weasel::space::AlterSpace

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

Event to alter the space model.

Alterations to the space model might have consequences on entities or on other aspects of the battle, as defined in alter_space.

Examples

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

battle_rules! {}

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

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

Implementations

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

pub fn trigger<P: EventProcessor<R>>(
    processor: &mut P,
    alteration: SpaceAlteration<R>
) -> AlterSpaceTrigger<'_, R, P>
[src]

Returns a trigger for this event.

pub fn alteration(&self) -> &SpaceAlteration<R>[src]

Returns the alteration to be applied to the space model.

Trait Implementations

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

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

impl<'de, R: BattleRules> Deserialize<'de> for AlterSpace<R> where
    SpaceAlteration<R>: Deserialize<'de>, 
[src]

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

impl<R: BattleRules> Serialize for AlterSpace<R> where
    SpaceAlteration<R>: Serialize
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for AlterSpace<R> where
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceAlteration: RefUnwindSafe

impl<R> Send for AlterSpace<R> where
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceAlteration: Send

impl<R> Sync for AlterSpace<R> where
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceAlteration: Sync

impl<R> Unpin for AlterSpace<R> where
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceAlteration: Unpin

impl<R> UnwindSafe for AlterSpace<R> where
    <<R as BattleRules>::SR as SpaceRules<R>>::SpaceAlteration: 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>,