[][src]Struct weasel::round::ResetRounds

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

Event to reset the rounds model.

This event can be fired only if no round is in progress.

Examples

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

battle_rules! {}

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

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

Implementations

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

pub fn trigger<P: EventProcessor<R>>(
    processor: &mut P
) -> ResetRoundsTrigger<R, P>
[src]

Returns a trigger for this event.

pub fn seed(&self) -> &Option<RoundsSeed<R>>[src]

Returns the new seed.

Trait Implementations

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

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

impl<'de, R: BattleRules> Deserialize<'de> for ResetRounds<R> where
    Option<RoundsSeed<R>>: Deserialize<'de>, 
[src]

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

impl<R: BattleRules> Serialize for ResetRounds<R> where
    Option<RoundsSeed<R>>: Serialize
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for ResetRounds<R> where
    <R as BattleRules>::RR: RoundsRules<R>,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsSeed: RefUnwindSafe

impl<R> Send for ResetRounds<R> where
    <R as BattleRules>::RR: RoundsRules<R>,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsSeed: Send

impl<R> Sync for ResetRounds<R> where
    <R as BattleRules>::RR: RoundsRules<R>,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsSeed: Sync

impl<R> Unpin for ResetRounds<R> where
    <R as BattleRules>::RR: RoundsRules<R>,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsSeed: Unpin

impl<R> UnwindSafe for ResetRounds<R> where
    <R as BattleRules>::RR: RoundsRules<R>,
    <<R as BattleRules>::RR as RoundsRules<R>>::RoundsSeed: 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>,