[−][src]Enum weasel::entity::EntityId
Id to uniquely identify an entity.
EntityId
is used as global id to identify entities in the game world
regardless of their type.
Variants
Creature(CreatureId<R>)
Standard creature.
Object(ObjectId<R>)
Inanimate object.
Implementations
impl<R: BattleRules> EntityId<R>
[src]
pub fn is_character(&self) -> bool
[src]
Returns whether this entity id refers to an object that satisfies the Character
trait.
pub fn is_actor(&self) -> bool
[src]
Returns whether this entity id refers to an object that satisfies the Actor
trait.
pub fn creature(&self) -> WeaselResult<CreatureId<R>, R>
[src]
Extracts a creature id out of this entity id.
Returns an error if the entity id's type is not Creature
.
pub fn object(&self) -> WeaselResult<ObjectId<R>, R>
[src]
Extracts an object id out of this entity id.
Returns an error if the entity id's type is not Object
.
Trait Implementations
impl<R: BattleRules> Clone for EntityId<R>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<R: BattleRules> Copy for EntityId<R> where
CreatureId<R>: Copy,
ObjectId<R>: Copy,
[src]
CreatureId<R>: Copy,
ObjectId<R>: Copy,
impl<R: BattleRules> Debug for EntityId<R>
[src]
impl<'de, R: BattleRules> Deserialize<'de> for EntityId<R> where
CreatureId<R>: Deserialize<'de>,
ObjectId<R>: Deserialize<'de>,
[src]
CreatureId<R>: Deserialize<'de>,
ObjectId<R>: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<R: BattleRules> Display for EntityId<R> where
CreatureId<R>: Display,
ObjectId<R>: Display,
[src]
CreatureId<R>: Display,
ObjectId<R>: Display,
impl<R: BattleRules> Eq for EntityId<R>
[src]
impl<R: BattleRules> Hash for EntityId<R>
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<R: BattleRules> PartialEq<EntityId<R>> for EntityId<R>
[src]
impl<R: BattleRules> Serialize for EntityId<R> where
CreatureId<R>: Serialize,
ObjectId<R>: Serialize,
[src]
CreatureId<R>: Serialize,
ObjectId<R>: Serialize,
Auto Trait Implementations
impl<R> RefUnwindSafe for EntityId<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 EntityId<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 EntityId<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 EntityId<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 EntityId<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<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,