Created "EntitySystem" class as means to group a World with a SystemPipeline

This commit is contained in:
2016-02-24 15:27:41 +01:00
parent 4aaba03852
commit 7cd4dac909
19 changed files with 370 additions and 135 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef EntitySystem_h__
#define EntitySystem_h__
#include "World.h"
#include "SystemPipeline.h"
// An "EntitySystem" is defined as the combination of a World with a SystemPipeline
template <typename WorldType>
class EntitySystem : public WorldType, public SystemPipeline
{
static_assert(std::is_base_of<World, WorldType>::value, "WorldType must inherit from World");
public:
EntitySystem(EventBroker* eventBroker, bool isClient, bool isServer)
: WorldType(eventBroker)
, SystemPipeline(this, eventBroker, isClient, isServer)
{ }
};
#endif