2024-01-05 10:15:41 -06:00
|
|
|
#include "2s2h/resource/importer/scenecommand/SetMinimapChestsFactory.h"
|
|
|
|
|
#include "2s2h/resource/type/scenecommand/SetMinimapChests.h"
|
|
|
|
|
#include "spdlog/spdlog.h"
|
|
|
|
|
|
2024-03-26 21:26:31 -04:00
|
|
|
namespace SOH {
|
2024-01-05 10:15:41 -06:00
|
|
|
|
2024-05-03 15:57:40 -04:00
|
|
|
std::shared_ptr<Ship::IResource> SetMinimapChestsFactory::ReadResource(std::shared_ptr<Ship::ResourceInitData> initData,
|
2024-05-22 09:52:56 -04:00
|
|
|
std::shared_ptr<Ship::BinaryReader> reader) {
|
2024-03-26 21:26:31 -04:00
|
|
|
auto chests = std::make_shared<SetMinimapChests>(initData);
|
2024-01-05 10:15:41 -06:00
|
|
|
|
|
|
|
|
ReadCommandId(chests, reader);
|
|
|
|
|
|
|
|
|
|
size_t size = reader->ReadUInt32();
|
|
|
|
|
|
|
|
|
|
chests->chests.reserve(size);
|
|
|
|
|
|
|
|
|
|
for (size_t i = 0; i < size; i++) {
|
|
|
|
|
MinimapChestData d;
|
|
|
|
|
d.unk_0 = reader->ReadUInt16();
|
|
|
|
|
d.unk_2 = reader->ReadUInt16();
|
|
|
|
|
d.unk_4 = reader->ReadUInt16();
|
|
|
|
|
d.unk_6 = reader->ReadUInt16();
|
|
|
|
|
d.unk_8 = reader->ReadUInt16();
|
|
|
|
|
chests->chests.emplace_back(d);
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-26 21:26:31 -04:00
|
|
|
return chests;
|
|
|
|
|
}
|
2024-05-22 09:52:56 -04:00
|
|
|
} // namespace SOH
|