2024-01-05 10:15:41 -06:00
|
|
|
#include "2s2h/resource/importer/scenecommand/SetPathwaysFactory.h"
|
|
|
|
|
#include "2s2h/resource/type/scenecommand/SetPathways.h"
|
|
|
|
|
#include "spdlog/spdlog.h"
|
|
|
|
|
#include <libultraship/libultraship.h>
|
|
|
|
|
|
2024-03-26 21:26:31 -04:00
|
|
|
namespace SOH {
|
2024-05-03 15:57:40 -04:00
|
|
|
std::shared_ptr<Ship::IResource> SetPathwaysMMFactory::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 setPathways = std::make_shared<SetPathwaysMM>(initData);
|
2024-05-22 09:52:56 -04:00
|
|
|
|
2024-01-05 10:15:41 -06:00
|
|
|
ReadCommandId(setPathways, reader);
|
|
|
|
|
|
|
|
|
|
setPathways->numPaths = reader->ReadUInt32();
|
|
|
|
|
setPathways->paths.reserve(setPathways->numPaths);
|
|
|
|
|
for (uint32_t i = 0; i < setPathways->numPaths; i++) {
|
|
|
|
|
std::string pathFileName = reader->ReadString();
|
|
|
|
|
auto path = std::static_pointer_cast<PathMM>(
|
2024-05-03 15:57:40 -04:00
|
|
|
Ship::Context::GetInstance()->GetResourceManager()->LoadResourceProcess(pathFileName.c_str()));
|
2024-01-05 10:15:41 -06:00
|
|
|
setPathways->paths.push_back(path->GetPointer());
|
|
|
|
|
}
|
2024-03-26 21:26:31 -04:00
|
|
|
return setPathways;
|
2024-01-05 10:15:41 -06:00
|
|
|
}
|
2024-03-26 21:26:31 -04:00
|
|
|
} // namespace SOH
|