[][src]Struct weasel::team::CreateTeam

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

Event to create a new team.

Examples

use weasel::{
    battle_rules, rules::empty::*, Battle, BattleController, BattleRules, CreateTeam,
    EventTrigger, 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();
assert_eq!(server.battle().entities().teams().count(), 1);

Implementations

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

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

Returns a trigger for this event.

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

Returns the team id.

pub fn relations(&self) -> &Option<Vec<(TeamId<R>, Relation)>>[src]

Returns the optional relations for the new team.

pub fn powers_seed(&self) -> &Option<PowersSeed<R>>[src]

Returns the seed to generate the team's powers.

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

Returns the seed to generate the team's objectives.

Trait Implementations

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

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

impl<'de, R: BattleRules> Deserialize<'de> for CreateTeam<R> where
    TeamId<R>: Deserialize<'de>,
    Option<Vec<(TeamId<R>, Relation)>>: Deserialize<'de>,
    Option<PowersSeed<R>>: Deserialize<'de>,
    Option<ObjectivesSeed<R>>: Deserialize<'de>, 
[src]

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

impl<R: BattleRules> Serialize for CreateTeam<R> where
    TeamId<R>: Serialize,
    Option<Vec<(TeamId<R>, Relation)>>: Serialize,
    Option<PowersSeed<R>>: Serialize,
    Option<ObjectivesSeed<R>>: Serialize
[src]

Auto Trait Implementations

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

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

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

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

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