Nox Engine
 
Loading...
Searching...
No Matches
ECS.h File Reference

Defines the core classes for the Entity-Component-System (ECS) architecture. More...

#include "Constants.h"
#include <algorithm>
#include <array>
#include <bitset>
#include <memory>
#include <stdexcept>
#include <string>
#include <vector>
Include dependency graph for ECS.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Component
 The base class for all components in the ECS. More...
 
struct  Entity
 A general-purpose object in the game world. More...
 
struct  Manager
 Manages all entities and their groups within the game. More...
 

Typedefs

using ComponentID = std::size_t
 
using GroupID = std::size_t
 
using ComponentBitSet = std::bitset< MAX_COMPONENTS >
 
using ComponentArray = std::array< std::shared_ptr< Component >, MAX_COMPONENTS >
 
using GroupBitSet = std::bitset< MAX_GROUPS >
 

Functions

ComponentID getNewComponentTypeID ()
 Generates a unique ID for a new component type at runtime.
 
template<typename T >
ComponentID getComponentTypeID () noexcept
 Gets the unique ID for a given component type.
 

Detailed Description

Defines the core classes for the Entity-Component-System (ECS) architecture.

Function Documentation

◆ getComponentTypeID()

template<typename T >
ComponentID getComponentTypeID ( )
inlinenoexcept

Gets the unique ID for a given component type.

Template Parameters
TThe component type.
Returns
The unique ComponentID for type T.
Here is the call graph for this function:

◆ getNewComponentTypeID()

ComponentID getNewComponentTypeID ( )
inline

Generates a unique ID for a new component type at runtime.

Returns
A new ComponentID.
Here is the caller graph for this function: