Open 3D Engine AzCore API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Member Functions | Static Public Attributes | Protected Attributes | Friends | List of all members
AZ::EntityId Class Reference

#include <EntityId.h>

Inherited by AZ::NamedEntityId.

Public Member Functions

 AZ_TYPE_INFO (EntityId, "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}")
 
AZ_FORCE_INLINE EntityId (u64 id=InvalidEntityId)
 
AZ_FORCE_INLINE operator u64 () const
 
AZ_FORCE_INLINE bool IsValid () const
 
AZ_FORCE_INLINE void SetInvalid ()
 
AZStd::string ToString () const
 
AZ_FORCE_INLINE bool operator== (const EntityId &rhs) const
 
AZ_FORCE_INLINE bool operator!= (const EntityId &rhs) const
 
AZ_FORCE_INLINE bool operator< (const EntityId &rhs) const
 
AZ_FORCE_INLINE bool operator> (const EntityId &rhs) const
 

Static Public Attributes

static const u64 InvalidEntityId = 0x00000000FFFFFFFFull
 

Protected Attributes

u64 m_id
 

Friends

class JsonEntityIdSerializer
 
class Entity
 

Detailed Description

Entity ID type. Entity IDs are used to uniquely identify entities. Each component that is attached to an entity is tagged with the entity's ID, and component buses are typically addressed by entity ID.

Constructor & Destructor Documentation

◆ EntityId()

AZ_FORCE_INLINE AZ::EntityId::EntityId ( u64  id = InvalidEntityId)
inlineexplicit

Creates an entity ID instance. If you do not provide a value for the entity ID, the entity ID is set to an invalid value.

Parameters
id(Optional) An ID for the entity.

Member Function Documentation

◆ AZ_TYPE_INFO()

AZ::EntityId::AZ_TYPE_INFO ( EntityId  ,
"{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}"   
)

Enables this class to be identified across modules and serialized into different contexts.

◆ IsValid()

AZ_FORCE_INLINE bool AZ::EntityId::IsValid ( ) const
inline

Determines whether this entity ID is valid. An entity ID is invalid if you did not provide an argument to the entity ID constructor.

Returns
Returns true if the entity ID is valid. Otherwise, false.

◆ operator u64()

AZ_FORCE_INLINE AZ::EntityId::operator u64 ( ) const
inlineexplicit

Casts the entity ID to u64.

Returns
The entity ID.

◆ operator!=()

AZ_FORCE_INLINE bool AZ::EntityId::operator!= ( const EntityId rhs) const
inline

Compares two entity IDs.

Parameters
rhsAn entity ID whose value you want to compare to the given entity ID.
Returns
True if the entity IDs are different. Otherwise, false.

◆ operator<()

AZ_FORCE_INLINE bool AZ::EntityId::operator< ( const EntityId rhs) const
inline

Evaluates whether the entity ID is less than a given entity ID.

Parameters
rhsAn entity ID whose size you want to compare to the given entity ID.
Returns
True if the entity ID is less than the given entity ID. Otherwise, false.

◆ operator==()

AZ_FORCE_INLINE bool AZ::EntityId::operator== ( const EntityId rhs) const
inline

Compares two entity IDs for equality.

Parameters
rhsAn entity ID whose value you want to compare to the given entity ID.
Returns
True if the entity IDs are equal. Otherwise, false.

◆ operator>()

AZ_FORCE_INLINE bool AZ::EntityId::operator> ( const EntityId rhs) const
inline

Evaluates whether the entity ID is greater than a given entity ID.

Parameters
rhsAn entity ID whose size you want to compare to the given entity ID.
Returns
True if the entity ID is greater than the given entity ID. Otherwise, false.

◆ SetInvalid()

AZ_FORCE_INLINE void AZ::EntityId::SetInvalid ( )
inline

Sets the entity ID to an invalid value.

◆ ToString()

AZStd::string AZ::EntityId::ToString ( ) const
inline

Returns the entity ID as a string.

Member Data Documentation

◆ InvalidEntityId

const u64 AZ::EntityId::InvalidEntityId = 0x00000000FFFFFFFFull
static

Invalid entity ID with a machine ID of 0 and the maximum timestamp.

◆ m_id

u64 AZ::EntityId::m_id
protected

Entity ID.


The documentation for this class was generated from the following file: