Made a Sound folder. Rename class Sound to SoundSystem.
Also awesome Cmakeness.
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
#include "CTemplate.h"
|
||||
#include "Rendering/CPointLight.h"
|
||||
#include "Transform/TransformSystem.h"
|
||||
#include "Core/Sound.h"
|
||||
#include "Sound/SoundSystem.h"
|
||||
#include "Game/LevelSystem.h"
|
||||
#include "Game/PadSystem.h"
|
||||
#include "Game/CBall.h"
|
||||
@@ -76,8 +76,8 @@ public:
|
||||
m_World->ComponentFactory.Register<Components::Model>();
|
||||
m_World->ComponentFactory.Register<Components::Template>();
|
||||
|
||||
m_World->SystemFactory.Register<Systems::Sound>([this]() { return new Systems::Sound(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::Sound>();
|
||||
m_World->SystemFactory.Register<Systems::SoundSystem>([this]() { return new Systems::SoundSystem(m_World.get(), m_EventBroker); });
|
||||
m_World->AddSystem<Systems::SoundSystem>();
|
||||
|
||||
m_World->ComponentFactory.Register<Components::Sprite>();
|
||||
|
||||
@@ -416,8 +416,6 @@ private:
|
||||
std::shared_ptr<InputManager> m_InputManager;
|
||||
std::shared_ptr<World> m_World;
|
||||
|
||||
//TODO: Delete this please
|
||||
std::shared_ptr<dd::Systems::Sound> m_Sound;
|
||||
|
||||
double m_LastTime;
|
||||
};
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "EventBroker.h"
|
||||
#include "EComponentCreated.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "Sound.h"
|
||||
|
||||
namespace dd
|
||||
{
|
||||
|
||||
@@ -25,19 +25,22 @@
|
||||
#include "Core/System.h"
|
||||
#include "Core/World.h"
|
||||
#include "Core/EKeyDown.h"
|
||||
#include "Core/EPlaySFX.h"
|
||||
#include "Sound/EPlaySFX.h"
|
||||
#include "Physics/EContact.h"
|
||||
#include "Core/EventBroker.h"
|
||||
#include <Game/CBall.h>
|
||||
#include <Game/CBrick.h>
|
||||
#include <Game/CPad.h>
|
||||
|
||||
namespace dd
|
||||
{
|
||||
namespace Systems
|
||||
{
|
||||
class Sound : public System {
|
||||
class SoundSystem : public System {
|
||||
public:
|
||||
Sound(World *world, std::shared_ptr<dd::EventBroker> eventBroker)
|
||||
SoundSystem(World *world, std::shared_ptr<dd::EventBroker> eventBroker)
|
||||
: System(world, eventBroker) { }
|
||||
~Sound();
|
||||
~SoundSystem();
|
||||
void Initialize() override;
|
||||
|
||||
//void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
@@ -53,9 +56,9 @@ public:
|
||||
|
||||
private:
|
||||
//Events
|
||||
dd::EventRelay<Sound, dd::Events::KeyDown> m_EKeyDown;
|
||||
dd::EventRelay<Sound, dd::Events::PlaySFX> m_EPlaySFX;
|
||||
dd::EventRelay<Sound, dd::Events::Contact> m_EContact;
|
||||
dd::EventRelay<SoundSystem, dd::Events::KeyDown> m_EKeyDown;
|
||||
dd::EventRelay<SoundSystem, dd::Events::PlaySFX> m_EPlaySFX;
|
||||
dd::EventRelay<SoundSystem, dd::Events::Contact> m_EContact;
|
||||
|
||||
bool OnKeyDown(const dd::Events::KeyDown &event);
|
||||
bool OnPlaySFX(const dd::Events::PlaySFX &event);
|
||||
Reference in New Issue
Block a user