ECSM v0.2.0
ecsm.hpp File Reference

Entity Component System Manager classes. More...

#include "singleton.hpp"
#include "linear-pool.hpp"
#include <set>
#include <map>
#include <mutex>
#include <algorithm>
#include <functional>
#include <type_traits>
#include <string_view>
#include <unordered_map>

Classes

struct  Component
 Base component structure. More...
 
class  System
 Base system class. More...
 
class  Entity
 An object containing components. More...
 
class  Manager
 Systems and entities coordinator. More...
 
struct  Manager::Event
 Event subscribers holder. More...
 
class  ComponentSystem< T, DestroyComponents >
 Base system class with components. More...
 
struct  DoNotDestroyComponent
 Component indicating that this entity should not be destroyed. More...
 
class  DoNotDestroySystem
 Handles entities that should not be destroyed. More...
 
struct  DoNotDuplicateComponent
 Component indicating that this entity should not be duplicated. More...
 
class  DoNotDuplicateSystem
 Handles entities that should not be duplicated. More...
 

Macros

#define ECSM_SUBSCRIBE_TO_EVENT(name, func)    ecsm::Manager::Instance::get()->subscribeToEvent(name, std::bind(&func, this))
 Subscribes System function to the event.
 
#define ECSM_UNSUBSCRIBE_FROM_EVENT(name, func)    ecsm::Manager::Instance::get()->unsubscribeFromEvent(name, std::bind(&func, this))
 Unsubscribes System function from the event.
 
#define ECSM_TRY_SUBSCRIBE_TO_EVENT(name, func)    ecsm::Manager::Instance::get()->trySubscribeToEvent(name, std::bind(&func, this))
 Subscribes System function to the event if exist.
 
#define ECSM_TRY_UNSUBSCRIBE_FROM_EVENT(name, func)    ecsm::Manager::Instance::get()->tryUnsubscribeFromEvent(name, std::bind(&func, this))
 Unsubscribes System function from the event if exist.
 

Detailed Description

Entity Component System Manager classes.