#pragma once #include #include "../Events/EventDispatcher.h" #include "../Logger/Logger.h" namespace L2Bot::Domain::Services { class ServiceLocator { public: static ServiceLocator& GetInstance() { static ServiceLocator instance; return instance; } const std::unique_ptr& GetEventDispatcher() { return m_EventDispatcher; } void SetEventDispatcher(std::unique_ptr dispatcher) { m_EventDispatcher = std::move(dispatcher); } const std::unique_ptr& GetLogger() { return m_Logger; } void SetLogger(std::unique_ptr logger) { m_Logger = std::move(logger); } private: ServiceLocator() = default; virtual ~ServiceLocator() = default; ServiceLocator(const ServiceLocator&) = delete; ServiceLocator& operator=(const ServiceLocator&) = delete; private: std::unique_ptr m_EventDispatcher; std::unique_ptr m_Logger; }; }