[−][src]Struct weasel::round::StartRound
Event to make an actor start a new round.
When an actor starts a round all his status effects will be updated.
Examples
use weasel::{ battle_rules, rules::empty::*, Battle, BattleController, BattleRules, CreateCreature, CreateTeam, EntityId, EventTrigger, Server, StartRound, }; battle_rules! {} let battle = Battle::builder(CustomRules::new()).build(); let mut server = Server::builder(battle).build(); let team_id = 1; CreateTeam::trigger(&mut server, team_id).fire().unwrap(); let creature_id = 1; let position = (); CreateCreature::trigger(&mut server, creature_id, team_id, position) .fire() .unwrap(); StartRound::trigger(&mut server, EntityId::Creature(creature_id)) .fire() .unwrap(); assert!(server .battle() .rounds() .state() .has_actor(&EntityId::Creature(creature_id)));
Implementations
impl<R: BattleRules> StartRound<R>
[src]
pub fn trigger<P: EventProcessor<R>>(
processor: &mut P,
id: EntityId<R>
) -> StartRoundTrigger<R, P>
[src]
processor: &mut P,
id: EntityId<R>
) -> StartRoundTrigger<R, P>
Returns a trigger for this event, to start a round with a single actor.
pub fn trigger_with_actors<P, I>(
processor: &mut P,
ids: I
) -> StartRoundTrigger<R, P> where
P: EventProcessor<R>,
I: IntoIterator<Item = EntityId<R>>,
[src]
processor: &mut P,
ids: I
) -> StartRoundTrigger<R, P> where
P: EventProcessor<R>,
I: IntoIterator<Item = EntityId<R>>,
Returns a trigger for this event, to start a round with a list of actors.
Duplicated ids will be dropped during the event's processing.
pub fn ids(&self) -> &Vec<EntityId<R>>
[src]
Returns the ids of the entities that will start the round.
Trait Implementations
impl<R: BattleRules> Clone for StartRound<R>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R: BattleRules> Debug for StartRound<R>
[src]
impl<'de, R: BattleRules> Deserialize<'de> for StartRound<R> where
Vec<EntityId<R>>: Deserialize<'de>,
[src]
Vec<EntityId<R>>: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<R: BattleRules + 'static> Event<R> for StartRound<R>
[src]
fn verify(&self, battle: &Battle<R>) -> WeaselResult<(), R>
[src]
fn apply(&self, battle: &mut Battle<R>, event_queue: &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: BattleRules> Serialize for StartRound<R> where
Vec<EntityId<R>>: Serialize,
[src]
Vec<EntityId<R>>: Serialize,
Auto Trait Implementations
impl<R> RefUnwindSafe for StartRound<R> where
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: RefUnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: RefUnwindSafe,
impl<R> Send for StartRound<R> where
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Send,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Send,
impl<R> Sync for StartRound<R> where
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Sync,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Sync,
impl<R> Unpin for StartRound<R> where
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: Unpin,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: Unpin,
impl<R> UnwindSafe for StartRound<R> where
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::CreatureId: UnwindSafe,
<<R as BattleRules>::CR as CharacterRules<R>>::ObjectId: 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,
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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,