#pragma once #include #include #include #include #include #include #include #include #include #include struct World : entt::registry { World(); ~World(); void Update() noexcept; RunnerService& GetRunner() noexcept; TransportService& GetTransport() noexcept; ModSystem& GetModSystem() noexcept; PartyService& GetPartyService() noexcept { return ctx().at(); } const PartyService& GetPartyService() const noexcept { return ctx().at(); } CharacterService& GetCharacterService() noexcept { return ctx().at(); } const CharacterService& GetCharacterService() const noexcept { return ctx().at(); } OverlayService& GetOverlayService() noexcept { return ctx().at(); } const OverlayService& GetOverlayService() const noexcept { return ctx().at(); } DebugService& GetDebugService() noexcept { return ctx().at(); } const DebugService& GetDebugService() const noexcept { return ctx().at(); } MagicService& GetMagicService() noexcept { return ctx().at(); } const MagicService& GetMagicService() const noexcept { return ctx().at(); } auto& GetDispatcher() noexcept { return m_dispatcher; } const ServerSettings& GetServerSettings() const noexcept { return m_serverSettings; } void SetServerSettings(ServerSettings aServerSettings) noexcept { m_serverSettings = aServerSettings; } [[nodiscard]] uint64_t GetTick() const noexcept; static void Create() noexcept; [[nodiscard]] static World& Get() noexcept; private: entt::dispatcher m_dispatcher; RunnerService m_runner; TransportService m_transport; ModSystem m_modSystem; ServerSettings m_serverSettings{}; std::chrono::high_resolution_clock::time_point m_lastFrameTime; };