engine/src/systems/custom_behaviour.cpp

32 lines
730 B
C++
Raw Normal View History

2023-05-25 17:35:32 +00:00
#include "systems/custom_behaviour.h"
#include <typeinfo>
#include "components/custom.h"
#include "components/transform.h"
#include "scene.h"
namespace engine {
CustomBehaviourSystem::CustomBehaviourSystem(Scene* scene)
: System(scene, {typeid(TransformComponent).hash_code(),
typeid(CustomComponent).hash_code()}) {
// constructor here
}
CustomBehaviourSystem::~CustomBehaviourSystem() {}
void CustomBehaviourSystem::OnUpdate(float ts) {
for (uint32_t entity : entities_) {
auto c = scene_->GetComponent<CustomComponent>(entity);
assert(c != nullptr);
c->onUpdate(ts);
}
}
2023-05-27 12:07:25 +00:00
void CustomBehaviourSystem::OnComponentInsert(uint32_t entity)
{
(void)entity;
}
2023-05-25 17:35:32 +00:00
} // namespace engine