[−][src]Struct weasel::round::EndRound
Event to trigger the end of the current round.
A round is a logical separator between turns and it can contain any
number of these.
Managing rounds is optional and not required in order to start or end turns.
The first round is implicitly started at the beginning of the battle.
Examples
use weasel::{ battle_rules, rules::empty::*, Battle, BattleController, BattleRules, EndRound, EventTrigger, Server, }; battle_rules! {} let battle = Battle::builder(CustomRules::new()).build(); let mut server = Server::builder(battle).build(); EndRound::trigger(&mut server).fire().unwrap(); assert_eq!( server.battle().rounds().completed_rounds(), 1 );
Implementations
impl<R: BattleRules> EndRound<R>
[src]
pub fn trigger<P: EventProcessor<R>>(
processor: &mut P
) -> EndRoundTrigger<'_, R, P>
[src]
processor: &mut P
) -> EndRoundTrigger<'_, R, P>
Returns a trigger for this event.
Trait Implementations
impl<R> Clone for EndRound<R>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R> Debug for EndRound<R>
[src]
impl<'de, R> Deserialize<'de> for EndRound<R>
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<R: BattleRules + 'static> Event<R> for EndRound<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> Serialize for EndRound<R>
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for EndRound<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for EndRound<R> where
R: Send,
R: Send,
impl<R> Sync for EndRound<R> where
R: Sync,
R: Sync,
impl<R> Unpin for EndRound<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for EndRound<R> where
R: UnwindSafe,
R: 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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,