pub struct EnvironmentTurn<R> { /* private fields */ }
Expand description
Event to perform a collective turn for the environment’s inanimate entities.
The purpose of this event is to update the statuses of all objects.
§Examples
use weasel::{
battle_rules, rules::empty::*, Battle, BattleController, BattleRules, EnvironmentTurn,
EventTrigger, Server,
};
battle_rules! {}
let battle = Battle::builder(CustomRules::new()).build();
let mut server = Server::builder(battle).build();
EnvironmentTurn::trigger(&mut server).fire().unwrap();
assert_eq!(
server.battle().rounds().completed_turns(),
1
);
Implementations§
Source§impl<R: BattleRules> EnvironmentTurn<R>
impl<R: BattleRules> EnvironmentTurn<R>
Sourcepub fn trigger<P: EventProcessor<R>>(
processor: &mut P,
) -> EnvironmentTurnTrigger<'_, R, P>
pub fn trigger<P: EventProcessor<R>>( processor: &mut P, ) -> EnvironmentTurnTrigger<'_, R, P>
Returns a trigger for this event.
Trait Implementations§
Source§impl<R> Clone for EnvironmentTurn<R>
impl<R> Clone for EnvironmentTurn<R>
Source§impl<R> Debug for EnvironmentTurn<R>
impl<R> Debug for EnvironmentTurn<R>
Source§impl<'de, R> Deserialize<'de> for EnvironmentTurn<R>
impl<'de, R> Deserialize<'de> for EnvironmentTurn<R>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<R: BattleRules + 'static> Event<R> for EnvironmentTurn<R>
impl<R: BattleRules + 'static> Event<R> for EnvironmentTurn<R>
Auto Trait Implementations§
impl<R> Freeze for EnvironmentTurn<R>
impl<R> RefUnwindSafe for EnvironmentTurn<R>where
R: RefUnwindSafe,
impl<R> Send for EnvironmentTurn<R>where
R: Send,
impl<R> Sync for EnvironmentTurn<R>where
R: Sync,
impl<R> Unpin for EnvironmentTurn<R>where
R: Unpin,
impl<R> UnwindSafe for EnvironmentTurn<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more