[][src]Struct weasel::team::ResetObjectives

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

Event to reset a team's objectives. Team's Conclusion is resetted as well since the objectives changed.

Examples

use weasel::{
    battle_rules, rules::empty::*, Battle, BattleController, BattleRules, ConcludeObjectives,
    Conclusion, CreateTeam, EventTrigger, ResetObjectives, Server,
};

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();
ConcludeObjectives::trigger(&mut server, team_id, Conclusion::Victory)
    .fire()
    .unwrap();

ResetObjectives::trigger(&mut server, team_id).fire().unwrap();
assert_eq!(
    server.battle().entities().team(&team_id).unwrap().conclusion(),
    None
);

Implementations

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

pub fn trigger<P: EventProcessor<R>>(
    processor: &mut P,
    id: TeamId<R>
) -> ResetObjectivesTrigger<'_, R, P>
[src]

Returns a trigger for this event.

pub fn id(&self) -> &TeamId<R>[src]

Returns the team id.

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

Returns the new seed.

Trait Implementations

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

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

impl<'de, R: BattleRules> Deserialize<'de> for ResetObjectives<R> where
    TeamId<R>: Deserialize<'de>,
    Option<ObjectivesSeed<R>>: Deserialize<'de>, 
[src]

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

impl<R: BattleRules> Serialize for ResetObjectives<R> where
    TeamId<R>: Serialize,
    Option<ObjectivesSeed<R>>: Serialize
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for ResetObjectives<R> where
    <<R as BattleRules>::TR as TeamRules<R>>::Id: RefUnwindSafe,
    <<R as BattleRules>::TR as TeamRules<R>>::ObjectivesSeed: RefUnwindSafe

impl<R> Send for ResetObjectives<R> where
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Send,
    <<R as BattleRules>::TR as TeamRules<R>>::ObjectivesSeed: Send

impl<R> Sync for ResetObjectives<R> where
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Sync,
    <<R as BattleRules>::TR as TeamRules<R>>::ObjectivesSeed: Sync

impl<R> Unpin for ResetObjectives<R> where
    <<R as BattleRules>::TR as TeamRules<R>>::Id: Unpin,
    <<R as BattleRules>::TR as TeamRules<R>>::ObjectivesSeed: Unpin

impl<R> UnwindSafe for ResetObjectives<R> where
    <<R as BattleRules>::TR as TeamRules<R>>::Id: UnwindSafe,
    <<R as BattleRules>::TR as TeamRules<R>>::ObjectivesSeed: 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>,