engine/include/system_custom_behaviour.h

24 lines
532 B
C
Raw Normal View History

2024-03-31 10:11:22 +00:00
#pragma once
2023-05-25 17:35:32 +00:00
#include <unordered_map>
2023-09-19 07:40:45 +00:00
#include "ecs.h"
2023-05-25 17:35:32 +00:00
/* This system allows for one-off custom components that execute arbitrary code
* It is similar to Unity's 'MonoBehavior' system */
namespace engine {
class CustomBehaviourSystem : public System {
2024-03-31 10:11:22 +00:00
public:
CustomBehaviourSystem(Scene* scene);
~CustomBehaviourSystem();
2023-05-25 17:35:32 +00:00
2024-06-04 18:01:49 +00:00
void onUpdate(float ts) override;
void onComponentInsert(Entity entity) override;
2023-05-25 17:35:32 +00:00
2024-03-31 10:11:22 +00:00
private:
std::unordered_map<Entity, bool> entity_is_initialised_{};
};
2023-05-25 17:35:32 +00:00
2024-03-31 10:11:22 +00:00
} // namespace engine