feat: update engine features

- WIP start/stop methods
- Remove test module
This commit is contained in:
Samsonium
2026-10-01 14:55:42 +03:00
parent a6676997d4
commit 7a158a0bf8
4 changed files with 63 additions and 24 deletions
+17 -1
View File
@@ -12,16 +12,32 @@
class MscEngine : public IMscEngineModuleAPI
{
private:
/// Loaded modules list
using clock = std::chrono::steady_clock;
/// @brief Loaded modules list
std::vector<std::shared_ptr<MscEngineModule>> _modules;
/// @brief Common event bus
MscEventBus _bus;
/// @brief Is engine running rn
bool _isRunning = false;
/// @brief Last update time
clock::time_point _lastUpdate;
public:
/// Actual version
static uint16_t REV;
MscEngine(std::vector<std::shared_ptr<MscEngineModule>> modules);
/// @brief Start engine
void start();
/// @brief Stop engine
void stop();
MscEventBus &getBus() override;
std::unordered_map<std::string, std::uint16_t> getLoadedModules() const override;
MscEngineModule &getModule(const std::string &name) override;
+19 -1
View File
@@ -23,8 +23,26 @@ public:
virtual const std::unordered_map<std::string, MscRevisionRange> &
getDependencies() const = 0;
/// Module initialization phase
/// @brief Module initialization
/// @param engine engine public API for modules
virtual void onInitialize(IMscEngineModuleAPI &engine) = 0;
/// @brief Engine start event handler
/// @param engine engine public API for modules
virtual void onStart(IMscEngineModuleAPI &engine) = 0;
/// @brief Engine update cycle step
/// @param engine engine public API for modules
/// @param dt loop delta
virtual void onUpdate(IMscEngineModuleAPI &engine, float dt) = 0;
/// @brief Engine stop event handler
/// @param engine engine public API for modules
virtual void onStop(IMscEngineModuleAPI &engine) = 0;
/// @brief Module destroying
/// @param engine engine public API for modules
virtual void onDestory(IMscEngineModuleAPI &engine) = 0;
};
#endif // __MCS_ENGINE_MODULE_HPP__