#ifndef __URDE_CGAMESTATE_HPP__ #define __URDE_CGAMESTATE_HPP__ #include #include "CBasics.hpp" #include "CPlayerState.hpp" #include "CGameOptions.hpp" #include "CRelayTracker.hpp" #include "World/CWorldTransManager.hpp" #include "AutoMapper/CMapWorldInfo.hpp" namespace urde { class CSaveWorldMemory; /* TODO: Figure out */ class CWorldSomethingState { friend class CSaveWorldIntermediate; std::vector x0_; u32 x10_bitCount = 0; std::vector x14_; public: CWorldSomethingState() = default; CWorldSomethingState(CBitStreamReader& reader, const CSaveWorld& saveWorld) { u32 bitCount = reader.ReadEncoded(10); u32 wordCount = (bitCount + 31) / 32; x14_.resize(wordCount); for (u32 i=0 ; i x8_relayTracker; std::shared_ptr xc_mapWorldInfo; u32 x10_; std::shared_ptr x14_; public: CWorldState(ResId id); CWorldState(CBitStreamReader& reader, ResId mlvlId, const CSaveWorld& saveWorld); ResId GetWorldAssetId() const {return x0_mlvlId;} void SetAreaId(TAreaId aid) { x4_areaId = aid; } TAreaId GetCurrentAreaId() const { return x4_areaId; } const std::shared_ptr& RelayTracker() const { return x8_relayTracker; } const std::shared_ptr& MapWorldInfo() const { return xc_mapWorldInfo; } const std::shared_ptr& GetSomethingElse() const { return x14_; } }; class CGameState { friend class CStateManager; bool x0_[128] = {}; ResId x84_mlvlId = -1; std::vector x88_worldStates; std::shared_ptr x98_playerState; std::shared_ptr x9c_transManager; double xa0_playTime; CPersistentOptions xa8_systemOptions; CGameOptions x17c_gameOptions; CHintOptions x1f8_hintOptions; union { struct { bool x228_24_; bool x228_25_deferPowerupInit; }; u8 _dummy = 0; }; public: CGameState(); CGameState(CBitStreamReader& stream); void SetCurrentWorldId(unsigned int id); std::shared_ptr GetPlayerState() {return x98_playerState;} std::shared_ptr GetWorldTransitionManager() {return x9c_transManager;} void SetTotalPlayTime(float time); CPersistentOptions& SystemOptions() { return xa8_systemOptions; } CGameOptions& GameOptions() { return x17c_gameOptions; } CWorldState& StateForWorld(ResId mlvlId); CWorldState& CurrentWorldState() { return StateForWorld(x84_mlvlId); } ResId CurrentWorldAssetId() const { return x84_mlvlId; } }; } #endif // __URDE_CGAMESTATE_HPP__