metaforce/Runtime/CMemoryCardSys.hpp

67 lines
1.9 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CMEMORYCARDSYS_HPP__
#define __URDE_CMEMORYCARDSYS_HPP__
2015-08-17 05:26:58 +00:00
2016-09-25 01:58:20 +00:00
#include "CToken.hpp"
#include "World/CWorld.hpp"
#include "CGameHintInfo.hpp"
#include "CSaveWorld.hpp"
2016-09-25 01:58:20 +00:00
#include <vector>
2016-03-04 23:04:53 +00:00
namespace urde
{
2016-09-25 01:58:20 +00:00
class CDummyWorld;
class CStringTable;
2016-09-25 01:58:20 +00:00
class CSaveWorldMemory
{
friend class CMemoryCardSys;
ResId x0_strgId = -1;
ResId x4_savwId = -1;
u32 x8_areaCount;
std::vector<TAreaId> xc_areaIds; /* 4 byte element */
std::vector<u32> x1c_; /* 16 byte element */
TLockedToken<CStringTable> x2c_worldName; /* used to be optional */
TLockedToken<CSaveWorld> x3c_saveWorld; /* used to be optional */
2016-09-25 01:58:20 +00:00
public:
ResId GetSaveWorldAssetId() const { return x4_savwId; }
u32 GetAreaCount() const { return x8_areaCount; }
const TLockedToken<CStringTable>& GetWorldName() const { return x2c_worldName; }
const TLockedToken<CSaveWorld>& GetSaveWorld() const { return x3c_saveWorld; }
2016-09-25 01:58:20 +00:00
};
class CSaveWorldIntermediate
2016-09-25 01:58:20 +00:00
{
friend class CMemoryCardSys;
u32 x0_mlvlId;
u32 x4_strgId;
u32 x8_savwId;
std::vector<TAreaId> xc_areaIds;
2016-09-25 01:58:20 +00:00
std::vector<u32> x1c_;
std::unique_ptr<CDummyWorld> x2c_dummyWorld;
TLockedToken<CSaveWorld> x34_saveWorld; /* Used to be auto_ptr */
public:
CSaveWorldIntermediate(ResId mlvl, ResId savw);
bool InitializePump();
2016-09-25 01:58:20 +00:00
};
2015-08-17 05:26:58 +00:00
class CMemoryCardSys
{
2016-09-25 01:58:20 +00:00
TLockedToken<CGameHintInfo> x0_hints;
std::vector<std::pair<ResId, CSaveWorldMemory>> xc_memoryWorlds; /* MLVL as key */
std::experimental::optional<std::vector<CSaveWorldIntermediate>> x1c_worldInter; /* used to be auto_ptr of vector */
std::unordered_map<ResId, CSaveWorld::EScanCategory> x20_scanStates;
2016-09-25 01:58:20 +00:00
public:
const std::vector<CGameHintInfo::CGameHint>& GetHints() const { return x0_hints->GetHints(); }
const std::vector<std::pair<ResId, CSaveWorldMemory>>& GetMemoryWorlds() const { return xc_memoryWorlds; }
2016-09-25 01:58:20 +00:00
CMemoryCardSys();
bool InitializePump();
2015-08-17 05:26:58 +00:00
};
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CMEMORYCARDSYS_HPP__