CoriEngine
Loading...
Searching...
No Matches
StateMachine.cpp
Go to the documentation of this file.
1#include "StateMachine.hpp"
3
4namespace Cori {
5 namespace World {
6 namespace Systems {
16
18 m_Owner.GetRegistry().on_construct<Components::Entity::StateMachine>().connect<&StateMachine::OnStateMachineCreate>(this);
19 return true;
20 }
21
22 void StateMachine::OnStateMachineCreate(entt::registry& registry, entt::entity entity) {
23 Entity e = entt::handle{ registry, entity };
25 sm.m_Owner = e;
26 }
27 }
28 }
29}
#define CORI_PROFILE_FUNCTION()
Definition Profiler.hpp:9
A GameTimer is responsible for managing everything that is connected with time, ticks,...
Definition Time.hpp:8
float GetTimestep() const
Returns the current timeStep, scale is in seconds.
Definition Time.hpp:31
A StateMachine component is used in combination with custom objects derived from EntityState.
Entities are the essential part of WorldSystem.
Definition Entity.hpp:25
decltype(auto) GetComponents()
Retries the references to the requested components of the entity.
Definition Entity.hpp:74
A wrapper for an EnTT compile-time view that provides an iterator to access Entity instances directly...
decltype(auto) Get(Entity entity)
Retries the components from an entity, both the components and the entity should be in a view,...
SceneHandle m_Owner
Definition System.hpp:38
void OnTickUpdate(Core::GameTimer &gameTimer) override
Anything connected to WorldSystem (ECS) is in this namespace.
Global engine namespace.
Helper to exclude certain components from a static view.