[][src]Struct weasel::entity::RemoveEntity

pub struct RemoveEntity<R> { /* fields omitted */ }

Helper to get an event trigger capable of removing an entity from the battle.
It delegates the actual work to a RemoveCreature or a RemoveObject.

Examples

use weasel::{
    battle_rules, rules::empty::*, Battle, BattleController, BattleRules, CreateCreature,
    CreateTeam, EntityId, EventTrigger, RemoveEntity, 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();
let creature_id = 1;
let entity_id = EntityId::Creature(creature_id);
let position = ();
CreateCreature::trigger(&mut server, creature_id, team_id, position)
    .fire()
    .unwrap();

RemoveEntity::trigger(&mut server, entity_id).fire().unwrap();
assert_eq!(server.battle().entities().creatures().count(), 0);

Implementations

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

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

Returns a trigger for this event helper.

Auto Trait Implementations

impl<R> RefUnwindSafe for RemoveEntity<R> where
    R: RefUnwindSafe

impl<R> Send for RemoveEntity<R> where
    R: Send

impl<R> Sync for RemoveEntity<R> where
    R: Sync

impl<R> Unpin for RemoveEntity<R> where
    R: Unpin

impl<R> UnwindSafe for RemoveEntity<R> where
    R: 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> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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>,