Working Spawner, SpawnPoint, PlayerSpawn and Team components, along with their systems.
This commit is contained in:
@@ -20,6 +20,8 @@ struct EntityWrapper
|
||||
::World* World;
|
||||
EntityID ID;
|
||||
|
||||
static const EntityWrapper Invalid;
|
||||
|
||||
bool HasComponent(const std::string& componentName);
|
||||
|
||||
ComponentWrapper operator[](const std::string& componentName);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Core/System.h"
|
||||
#include "Input/EInputCommand.h"
|
||||
#include "Systems/SpawnerSystem.h"
|
||||
#include "Events/ESpawnerSpawn.h"
|
||||
|
||||
class PlayerSpawnSystem : public ImpureSystem
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#ifndef SpawnerSystem_h__
|
||||
#define SpawnerSystem_h__
|
||||
|
||||
#include <random>
|
||||
#include "Common.h"
|
||||
#include "GLM.h"
|
||||
@@ -12,9 +15,11 @@ class SpawnerSystem : public System
|
||||
public:
|
||||
SpawnerSystem(EventBroker* eventBroker);
|
||||
|
||||
static EntityWrapper Spawn(EntityWrapper spawner, EntityWrapper parent = EntityWrapper::Invalid);
|
||||
|
||||
private:
|
||||
EventRelay<SpawnerSystem, Events::SpawnerSpawn> m_OnSpawnerSpawn;
|
||||
bool OnSpawnerSpawn(Events::SpawnerSpawn& e);
|
||||
};
|
||||
|
||||
void spawnEntity(EntityWrapper spawner, EntityID parent, glm::vec3 position);
|
||||
};
|
||||
#endif
|
||||
Reference in New Issue
Block a user