Menu
Lumberyard
C++ API Reference (Version 1.10)

Entity ID type. More...

Public Member Functions

 AZ_TYPE_INFO (EntityId, "{6383F1D3-BB27-4E6B-A49A-6409B2059EAA}")
 Enables this class to be identified across modules and serialized into different contexts. More...
 
AZ_FORCE_INLINE EntityId (u64 id=InvalidEntityId)
 Creates an entity ID instance. More...
 
AZ_FORCE_INLINE operator u64 () const
 Casts the entity ID to u64. More...
 
AZ_FORCE_INLINE bool IsValid () const
 Determines whether this entity ID is valid. More...
 
AZ_FORCE_INLINE void SetInvalid ()
 Sets the entity ID to an invalid value. More...
 
AZStd::string ToString () const
 Returns the entity ID as a string. More...
 
AZ_FORCE_INLINE bool operator== (const EntityId &rhs) const
 Compares two entity IDs for equality. More...
 
AZ_FORCE_INLINE bool operator!= (const EntityId &rhs) const
 Compares two entity IDs. More...
 
AZ_FORCE_INLINE bool operator< (const EntityId &rhs) const
 Evaluates whether the entity ID is less than a given entity ID. More...
 

Static Public Attributes

static const u64 InvalidEntityId
 Invalid entity ID with a machine ID of 0 and the maximum timestamp. More...
 

Protected Attributes

u64 m_id
 Entity ID. More...
 

Friends

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.

◆ 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.

Friends And Related Function Documentation

◆ Entity

friend class Entity
friend

Member Data Documentation

◆ InvalidEntityId

const u64 AZ::EntityId::InvalidEntityId
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:
  • C:/lumberyard-root/dev/Code/Framework/AzCore/AzCore/Component/EntityId.h