Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
Entity Component System

Topics

 Systems
 
 Components
 

Files

file  ecs_world.hpp
 ToyMaker Engine's implementation of an ECS system.
 

Classes

class  ToyMaker::ECSWorld
 A class that represents a set of systems, entities, and components, that are all interrelated, but isolated from other similar sets. More...
 
class  ToyMaker::Entity
 The Entity is a wrapper on an entity ID, used as the primary interface between an application and the engine's ECS system. More...
 

Typedefs

using ToyMaker::EntityID = std::uint64_t
 A single unsigned integer used as a name for an entity managed by an ECS system.
 
using ToyMaker::WorldID = std::uint64_t
 An unsigned integer representing the name of an ECS world.
 
using ToyMaker::UniversalEntityID = std::pair<WorldID, EntityID>
 An ID that uniquely identifies an entity.
 
using ToyMaker::ECSType = std::uint8_t
 A number tag used to represent components and systems.
 

Variables

constexpr EntityID ToyMaker::kMaxEntities { 1000000 }
 A user-set constant which limits the number of creatable entities in a single ECS system.
 
constexpr ECSType ToyMaker::kMaxECSTypes { 255 }
 A constant used to restrict the number of definable system and component types in a project.
 

Detailed Description

Typedef Documentation

◆ ECSType

using ToyMaker::ECSType = std::uint8_t

A number tag used to represent components and systems.

Warning
There can be no more than 254 different systems and types.

◆ EntityID

using ToyMaker::EntityID = std::uint64_t

A single unsigned integer used as a name for an entity managed by an ECS system.

All components belonging to an entity will also have the entity's id associated with it.

◆ UniversalEntityID

An ID that uniquely identifies an entity.

This ID is made by appending the ID of the entity to the ID of the world the entity belongs to. Together, they uniquely identify an entity within the entire application

◆ WorldID

using ToyMaker::WorldID = std::uint64_t

An unsigned integer representing the name of an ECS world.

A single application may contain multiple "Worlds" – a set of tables containing entities and the components that describe them. Each world is given an ID in turn.