neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
neogfx::game::ecs Class Reference

#include <ecs.hpp>

Inheritance diagram for neogfx::game::ecs:
neolib::ecs::ecs neogfx::i_vertex_provider neolib::object< i_ecs > neolib::lifetime< Base > neolib::i_lifetime

Public Member Functions

 ecs (ecs_flags aCreationFlags=ecs_flags::Default)
 
 ~ecs ()
 
bool run_threaded (const system_id &aSystemId) const override
 
void destroy_entity (entity_id aEntityId, bool aNotify=true) override
 
bool cacheable () const override
 
const game::component< game::mesh_render_cache > & cache () const override
 
game::component< game::mesh_render_cache > & cache () override
 
- Public Member Functions inherited from neolib::ecs::ecs
 define_declared_event (SystemsPaused, systems_paused) define_declared_event(SystemsResumed
 
systems_resumed define_declared_event (EntityCreated, entity_created, entity_id) define_declared_event(EntityDestroyed
 
 ecs (ecs_flags aCreationFlags=ecs_flags::Default)
 
 ~ecs ()
 
neolib::recursive_spinlockmutex () const override
 
neolib::thread_poolthread_pool () const override
 
ecs_flags flags () const override
 
entity_id create_entity (const entity_archetype_id &aArchetypeId) override
 
void async_create_entity (const std::function< void()> &aCreator) override
 
void commit_async_entity_creation () override
 
void destroy_entity (entity_id aEntityId, bool aNotify=true) override
 
void async_destroy_entity (entity_id aEntityId, bool aNotify=true) override
 
void commit_async_entity_destruction () override
 
bool run_threaded (const system_id &aSystemId) const override
 
bool all_systems_paused () const override
 
void pause_all_systems () override
 
void resume_all_systems () override
 
const archetype_registry_t & archetypes () const override
 
archetype_registry_t & archetypes () override
 
const component_factories_t & component_factories () const override
 
component_factories_t & component_factories () override
 
const components_t & components () const override
 
components_t & components () override
 
const shared_component_factories_t & shared_component_factories () const override
 
shared_component_factories_t & shared_component_factories () override
 
const shared_components_t & shared_components () const override
 
shared_components_t & shared_components () override
 
const system_factories_t & system_factories () const override
 
system_factories_t & system_factories () override
 
const systems_t & systems () const override
 
systems_t & systems () override
 
const i_entity_archetypearchetype (entity_archetype_id aArchetypeId) const override
 
i_entity_archetypearchetype (entity_archetype_id aArchetypeId) override
 
bool component_instantiated (component_id aComponentId) const override
 
const i_componentcomponent (component_id aComponentId) const override
 
i_componentcomponent (component_id aComponentId) override
 
bool shared_component_instantiated (component_id aComponentId) const override
 
const i_shared_componentshared_component (component_id aComponentId) const override
 
i_shared_componentshared_component (component_id aComponentId) override
 
bool system_instantiated (system_id aSystemId) const override
 
const i_systemsystem (system_id aSystemId) const override
 
i_systemsystem (system_id aSystemId) override
 
entity_id next_entity_id () override
 
void free_entity_id (entity_id aId) override
 
bool archetype_registered (const i_entity_archetype &aArchetype) const override
 
void register_archetype (const i_entity_archetype &aArchetype) override
 
void register_archetype (std::shared_ptr< const i_entity_archetype > aArchetype) override
 
bool component_registered (component_id aComponentId) const override
 
void register_component (component_id aComponentId, component_factory aFactory) override
 
bool shared_component_registered (component_id aComponentId) const override
 
void register_shared_component (component_id aComponentId, shared_component_factory aFactory) override
 
bool system_registered (system_id aSystemId) const override
 
void register_system (system_id aSystemId, system_factory aFactory) override
 
handle_t to_handle (handle_id aId) const override
 
handle_id add_handle (const std::type_info &aTypeInfo, handle_t aHandle) override
 
handle_t update_handle (handle_id aId, const std::type_info &aTypeInfo, handle_t aHandle) override
 
handle_t release_handle (handle_id aId) override
 
virtual entity_id create_entity (const entity_archetype_id &aArchetypeId)=0
 
template<typename... ComponentData>
entity_id create_entity (const entity_archetype_id &aArchetypeId, ComponentData &&... aComponentData)
 
template<typename Archetype , typename... ComponentData>
entity_id create_entity (const Archetype &aArchetype, ComponentData &&... aComponentData)
 
template<typename ComponentData , typename... ComponentDataRest>
void populate (entity_id aEntity, ComponentData &&aComponentData, ComponentDataRest &&... aComponentDataRest)
 
template<typename ComponentData >
void populate (entity_id aEntity, ComponentData &&aComponentData)
 
template<typename ComponentData , typename... ComponentDataRest>
void populate_shared (const std::string &aName, ComponentData &&aComponentData, ComponentDataRest &&... aComponentDataRest)
 
template<typename ComponentData >
void populate_shared (const std::string &aName, ComponentData &&aComponentData)
 
virtual bool component_instantiated (component_id aComponentId) const=0
 
template<typename ComponentData >
bool component_instantiated () const
 
virtual const i_componentcomponent (component_id aComponentId) const=0
 
virtual i_componentcomponent (component_id aComponentId)=0
 
template<typename ComponentData >
const neolib::ecs::component< ComponentData > & component () const
 
template<typename ComponentData >
neolib::ecs::component< ComponentData > & component ()
 
virtual bool shared_component_instantiated (component_id aComponentId) const=0
 
template<typename ComponentData >
bool shared_component_instantiated () const
 
virtual const i_shared_componentshared_component (component_id aComponentId) const=0
 
virtual i_shared_componentshared_component (component_id aComponentId)=0
 
template<typename ComponentData >
const neolib::ecs::shared_component< ComponentData > & shared_component () const
 
template<typename ComponentData >
neolib::ecs::shared_component< ComponentData > & shared_component ()
 
virtual bool system_instantiated (system_id aSystemId) const=0
 
template<typename System >
bool system_instantiated () const
 
virtual const i_systemsystem (system_id aSystemId) const=0
 
virtual i_systemsystem (system_id aSystemId)=0
 
template<typename System >
const ecs_data_type_t< System > & system () const
 
template<typename System >
ecs_data_type_t< System > & system ()
 
virtual bool component_registered (component_id aComponentId) const=0
 
template<typename ComponentData >
bool component_registered () const
 
virtual void register_component (component_id aComponentId, component_factory aFactory)=0
 
template<typename ComponentData >
void register_component ()
 
virtual bool shared_component_registered (component_id aComponentId) const=0
 
template<typename ComponentData >
bool shared_component_registered () const
 
virtual void register_shared_component (component_id aComponentId, shared_component_factory aFactory)=0
 
template<typename ComponentData >
void register_shared_component ()
 
virtual bool system_registered (system_id aSystemId) const=0
 
template<typename System >
bool system_registered () const
 
virtual void register_system (system_id aSystemId, system_factory aFactory)=0
 
template<typename System >
void register_system ()
 
- Public Member Functions inherited from neolib::object< i_ecs >
 define_declared_event (Destroying, destroying)
 
 define_declared_event (Destroyed, destroyed)
 
 object (lifetime_state aState=lifetime_state::Creating)
 
 ~object ()
 
void set_destroying () override
 
void set_destroyed () override
 
bool is_alive () const final
 
bool is_destroyed () const final
 
- Public Member Functions inherited from neolib::lifetime< Base >
 lifetime (lifetime_state aState=lifetime_state::Alive)
 
virtual ~lifetime ()
 
lifetime_state object_state () const final
 
std::shared_ptr< std::atomic< lifetime_state > > object_state_ptr () const final
 
bool is_creating () const final
 
bool is_destroying () const final
 
void set_alive () override
 
- Public Member Functions inherited from neolib::i_lifetime
virtual ~i_lifetime ()=default
 
- Public Member Functions inherited from neogfx::i_vertex_provider
virtual ~i_vertex_provider ()=default
 

Additional Inherited Members

- Public Types inherited from neolib::lifetime< Base >
typedef neolib::destroyed_flag destroyed_flag
 
- Public Attributes inherited from neolib::ecs::ecs
systems_resumed entity_destroyed
 

Detailed Description

Definition at line 32 of file ecs.hpp.

Constructor & Destructor Documentation

◆ ecs()

neogfx::game::ecs::ecs ( ecs_flags  aCreationFlags = ecs_flags::Default)

◆ ~ecs()

neogfx::game::ecs::~ecs ( )

Member Function Documentation

◆ cache() [1/2]

const game::component< game::mesh_render_cache > & neogfx::game::ecs::cache ( ) const
overridevirtual

◆ cache() [2/2]

game::component< game::mesh_render_cache > & neogfx::game::ecs::cache ( )
overridevirtual

◆ cacheable()

bool neogfx::game::ecs::cacheable ( ) const
overridevirtual

◆ destroy_entity()

void neogfx::game::ecs::destroy_entity ( entity_id  aEntityId,
bool  aNotify = true 
)
override

◆ run_threaded()

bool neogfx::game::ecs::run_threaded ( const system_id aSystemId) const
override

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