CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::EntityID Struct Referencefinal

#include <CeresEngine/Entity/EntityID.hpp>

Public Member Functions

 EntityID () noexcept=default
 Creates a new empty EntityID.
 
 EntityID (const EntityID &other) noexcept=default
 Creates a new entity ID by copying the contents of another.
 
EntityIDoperator= (const EntityID &other) noexcept=default
 Assings the entity ID contents by copying the contents of another.
 
 EntityID (const EntityIndex index, const EntityVersion version) noexcept
 Creates a new entity ID from it's index and version.
 

Public Attributes

EntityIndex index = 0
 The entity index.
 
EntityVersion version = 0
 The entity version.
 

Friends

constexpr bool operator== (const EntityID &a, const EntityID &b) noexcept
 Compares two entity IDs for equality.
 
constexpr bool operator!= (const EntityID &a, const EntityID &b) noexcept
 Compares two entity IDs for inequality.
 
std::ostream & operator<< (std::ostream &os, const EntityID &entityID)
 Prints a string representation of the Entity ID.
 

Constructor & Destructor Documentation

◆ EntityID() [1/3]

CeresEngine::EntityID::EntityID ( )
inlinedefaultnoexcept

Creates a new empty EntityID.

◆ EntityID() [2/3]

CeresEngine::EntityID::EntityID ( const EntityID other)
defaultnoexcept

Creates a new entity ID by copying the contents of another.

Parameters
otherThe instance to copy from

◆ EntityID() [3/3]

CeresEngine::EntityID::EntityID ( const EntityIndex  index,
const EntityVersion  version 
)
inlinenoexcept

Creates a new entity ID from it's index and version.

Parameters
indexThe entity index
versionThe entity version

Member Function Documentation

◆ operator=()

EntityID & CeresEngine::EntityID::operator= ( const EntityID other)
defaultnoexcept

Assings the entity ID contents by copying the contents of another.

Parameters
otherThe instance to copy from
Returns
This

Friends And Related Symbol Documentation

◆ operator!=

constexpr bool operator!= ( const EntityID a,
const EntityID b 
)
friend

Compares two entity IDs for inequality.

Two entity IDs are considered equal iff their index and version match.

Parameters
aThe left hand side operator argument
bThe right hand side operator argument
Returns
True if the two IDs can be considered equal

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const EntityID entityID 
)
friend

Prints a string representation of the Entity ID.

Parameters
osThe outut stream to print to
entityIDThe entity ID to be printe
Returns
The given os

◆ operator==

constexpr bool operator== ( const EntityID a,
const EntityID b 
)
friend

Compares two entity IDs for equality.

Two entity IDs are considered equal iff their index and version match.

Parameters
aThe left hand side operator argument
bThe right hand side operator argument
Returns
True if the two IDs can be considered equal

Member Data Documentation

◆ index

EntityIndex CeresEngine::EntityID::index = 0

The entity index.

◆ version

EntityVersion CeresEngine::EntityID::version = 0

The entity version.


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