60 friend inline constexpr bool operator==(
const EntityID& a,
const EntityID& b)
noexcept {
return a.index == b.index && a.version == b.version; }
67 friend inline constexpr bool operator!=(
const EntityID& a,
const EntityID& b)
noexcept {
return a.index != b.index || a.version != b.version; }
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition EntityID.hpp:76
void release(EntityID entityID) noexcept
Releases a previously allocated entity ID.
HashMap< EntityIndex, EntityVersion > mEntityVersions
A map of entity versions, indexed by their entity indexes.
Definition EntityID.hpp:79
EntityVersion getLatestVersion(EntityIndex index) const noexcept
Gets the latest version of a given entity index.
EntityID allocate() noexcept
Allocates a new entity ID from the allocator.
EntityIndex mNextEntityIndex
The EntityIndex for the next entity allocation if the freeList is empty.
Definition EntityID.hpp:83
Vector< EntityID > mFreeList
A list of free entities that are ready to be reused.
Definition EntityID.hpp:86
Definition Application.hpp:19
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
UInt32 EntityVersion
Definition EntityID.hpp:23
std::unordered_map< Key, T, Hash, KeyEqual, ScopedAllocatorAdaptor< StdAllocator< Pair< const Key, T >, RawAllocator > > > HashMap
HashMap is an associative container that contains key-value pairs with unique keys.
Definition Map.hpp:33
std::uint32_t UInt32
Definition DataTypes.hpp:23
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
UInt32 EntityIndex
Definition EntityID.hpp:22
Definition EntityID.hpp:25
EntityIndex index
The entity index.
Definition EntityID.hpp:28
EntityVersion version
The entity version.
Definition EntityID.hpp:32
friend std::ostream & operator<<(std::ostream &os, const EntityID &entityID)
Prints a string representation of the Entity ID.
friend constexpr bool operator==(const EntityID &a, const EntityID &b) noexcept
Compares two entity IDs for equality.
Definition EntityID.hpp:60
friend constexpr bool operator!=(const EntityID &a, const EntityID &b) noexcept
Compares two entity IDs for inequality.
Definition EntityID.hpp:67