feat: add event bus to engine public API
This commit is contained in:
@@ -13,6 +13,7 @@ class MscEngine : public IMscEngineModuleAPI
|
|||||||
private:
|
private:
|
||||||
/// Loaded modules list
|
/// Loaded modules list
|
||||||
std::vector<std::shared_ptr<MscEngineModule>> _modules;
|
std::vector<std::shared_ptr<MscEngineModule>> _modules;
|
||||||
|
MscEventBus _bus;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Actual version
|
/// Actual version
|
||||||
@@ -20,7 +21,7 @@ public:
|
|||||||
|
|
||||||
MscEngine(std::vector<std::shared_ptr<MscEngineModule>> modules);
|
MscEngine(std::vector<std::shared_ptr<MscEngineModule>> modules);
|
||||||
|
|
||||||
UNIMPL getBus() const override;
|
MscEventBus &getBus() override;
|
||||||
UNIMPL getLoadedModules() const override;
|
UNIMPL getLoadedModules() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#ifndef __MSC_ENGINE_MODULE_API_HPP__
|
#ifndef __MSC_ENGINE_MODULE_API_HPP__
|
||||||
#define __MSC_ENGINE_MODULE_API_HPP__
|
#define __MSC_ENGINE_MODULE_API_HPP__
|
||||||
|
|
||||||
|
#include <engine/core/engine_bus.hpp>
|
||||||
|
|
||||||
typedef void UNIMPL;
|
typedef void UNIMPL;
|
||||||
|
|
||||||
class IMscEngineModuleAPI
|
class IMscEngineModuleAPI
|
||||||
@@ -9,7 +11,7 @@ public:
|
|||||||
virtual ~IMscEngineModuleAPI() = default;
|
virtual ~IMscEngineModuleAPI() = default;
|
||||||
|
|
||||||
/// Get access to engine event bus
|
/// Get access to engine event bus
|
||||||
virtual UNIMPL getBus() const = 0;
|
virtual MscEventBus &getBus() = 0;
|
||||||
|
|
||||||
/// Get access to loaded module list
|
/// Get access to loaded module list
|
||||||
virtual UNIMPL getLoadedModules() const = 0;
|
virtual UNIMPL getLoadedModules() const = 0;
|
||||||
|
|||||||
@@ -54,7 +54,10 @@ MscEngine::MscEngine(std::vector<std::shared_ptr<MscEngineModule>> modules)
|
|||||||
_modules = std::move(modules);
|
_modules = std::move(modules);
|
||||||
}
|
}
|
||||||
|
|
||||||
UNIMPL MscEngine::getBus() const { throw std::runtime_error("Unimplemented"); }
|
MscEventBus &MscEngine::getBus()
|
||||||
|
{
|
||||||
|
return _bus;
|
||||||
|
}
|
||||||
|
|
||||||
UNIMPL MscEngine::getLoadedModules() const
|
UNIMPL MscEngine::getLoadedModules() const
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user