Använder Eventbaserade OnComponentCreated funktionen

This commit is contained in:
Stiffly
2014-05-25 04:02:08 +02:00
parent 072e4d4dbb
commit e3e0d549f5
3 changed files with 61 additions and 69 deletions
+3 -4
View File
@@ -8,6 +8,7 @@
#include "Components/Transform.h"
#include "Components/SoundEmitter.h"
#include "Components/Listener.h"
#include "Events/ComponentCreated.h"
#include "Events/PlaySound.h"
#include "Sound.h"
@@ -25,13 +26,11 @@ public:
void Initialize() override;
void Update(double dt) override;
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
void OnComponentCreated(std::string type, std::shared_ptr<Component> component) override;
void OnEntityCommit(EntityID entity) override;
private:
// Events
EventRelay<SoundSystem, Events::ComponentCreated> m_EComponentCreated;
bool OnComponentCreated(const Events::ComponentCreated &event);
EventRelay<SoundSystem, Events::PlaySound> m_EPlaySound;
FMOD_RESULT LoadSound(FMOD_SOUND*&, std::string, float, float, bool, float, float);