Add Scene with systems
- Add Scene class which populates the engine with Systems which handles all logic in the game - Add Systems to ecs
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include "copium/ecs/ECSManager.h"
|
||||
#include "copium/ecs/SystemBase.h"
|
||||
#include "copium/ecs/Entity.h"
|
||||
|
||||
namespace Copium
|
||||
{
|
||||
template <typename... Components>
|
||||
class System : public SystemBase
|
||||
{
|
||||
public:
|
||||
void Run() override
|
||||
{
|
||||
manager->Each<Components...>([&](EntityID entityId, Components&... components) { RunEntity(Entity{manager, entityId}, components...); });
|
||||
}
|
||||
|
||||
virtual void RunEntity(Entity entity, Components&... components) = 0;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user