Files

29 lines
1.2 KiB
C++
Raw Permalink Normal View History

2024-01-05 10:15:41 -06:00
#pragma once
#include "2s2h/resource/type/Scene.h"
#include "2s2h/resource/type/scenecommand/SceneCommand.h"
#include "2s2h/resource/importer/scenecommand/SceneCommandFactory.h"
#include "Resource.h"
2024-03-26 21:26:31 -04:00
#include "ResourceFactoryBinary.h"
2024-01-05 10:15:41 -06:00
2024-03-26 21:26:31 -04:00
namespace SOH {
class ResourceFactoryBinarySceneV0 : public Ship::ResourceFactoryBinary {
2024-01-05 10:15:41 -06:00
public:
2024-03-26 21:26:31 -04:00
ResourceFactoryBinarySceneV0();
std::shared_ptr<Ship::IResource> ReadResource(std::shared_ptr<Ship::File> file) override;
void ParseSceneCommands(std::shared_ptr<Scene> scene, std::shared_ptr<Ship::BinaryReader> reader);
2024-01-05 10:15:41 -06:00
// Doing something very similar to what we do on the ResourceLoader.
// Eventually, scene commands should be moved up to the ResourceLoader as well.
// They can not right now because the exporter does not give them a proper resource type enum value,
// and the exporter does not export the commands with a proper OTR header.
2024-03-26 21:26:31 -04:00
static inline std::unordered_map<SceneCommandID, std::shared_ptr<SceneCommandFactoryBinaryV0>>
sceneCommandFactories;
2024-01-05 10:15:41 -06:00
2024-03-26 21:26:31 -04:00
protected:
std::shared_ptr<ISceneCommand> ParseSceneCommand(std::shared_ptr<Scene> scene,
std::shared_ptr<Ship::BinaryReader> reader, uint32_t index);
2024-01-05 10:15:41 -06:00
};
} // namespace SOH