#pragma once #include "Services/AdminService.h" #include #include #include #include #include #include #include "Game/PlayerManager.h" namespace ESLoader { struct RecordCollection; } struct World : entt::registry { World(); ~World() noexcept; TP_NOCOPYMOVE(World); entt::dispatcher& GetDispatcher() noexcept { return m_dispatcher; } const entt::dispatcher& GetDispatcher() const noexcept { return m_dispatcher; } CharacterService& GetCharacterService() noexcept { return ctx().at(); } const CharacterService& GetCharacterService() const noexcept { return ctx().at(); } PlayerService& GetPlayerService() noexcept { return ctx().at(); } const PlayerService& GetPlayerService() const noexcept { return ctx().at(); } PartyService& GetPartyService() noexcept { return ctx().at(); } const PartyService& GetPartyService() const noexcept { return ctx().at(); } CalendarService& GetCalendarService() noexcept { return ctx().at(); } const CalendarService& GetCalendarService() const noexcept { return ctx().at(); } QuestService& GetQuestService() noexcept { return ctx().at(); } const QuestService& GetQuestService() const noexcept { return ctx().at(); } PlayerManager& GetPlayerManager() noexcept { return m_playerManager; } const PlayerManager& GetPlayerManager() const noexcept { return m_playerManager; } ScriptService& GetScriptService() const noexcept { return *m_pScriptService; } // Null checked at start when MoPo is on! ESLoader::RecordCollection* GetRecordCollection() noexcept { return m_recordCollection.get(); } const ESLoader::RecordCollection* GetRecordCollection() const noexcept { return m_recordCollection.get(); } [[nodiscard]] static uint32_t ToInteger(entt::entity aEntity) { return to_integral(aEntity); } private: entt::dispatcher m_dispatcher; TiltedPhoques::SharedPtr m_spAdminService; TiltedPhoques::UniquePtr m_pScriptService; PlayerManager m_playerManager; UniquePtr m_recordCollection; };