30 lines
774 B
C++
30 lines
774 B
C++
#pragma once
|
|
|
|
#include "cutscene/CutsceneTypes.h"
|
|
#include "external/nlohmann/json.hpp"
|
|
#include <string>
|
|
#include <unordered_map>
|
|
|
|
namespace ZL::Cutscene {
|
|
|
|
class CutsceneDatabase {
|
|
public:
|
|
using json = nlohmann::json;
|
|
|
|
bool loadFromFile(const std::string& path);
|
|
|
|
const StaticCutsceneDefinition* findCutscene(const std::string& id) const;
|
|
|
|
private:
|
|
std::unordered_map<std::string, StaticCutsceneDefinition> cutscenes;
|
|
|
|
static EasingType parseEasingType(const std::string& value);
|
|
|
|
static CutsceneLine parseCutsceneLine(const json& j);
|
|
static CutsceneImagePose parseCutsceneImagePose(const json& j);
|
|
static CutsceneImageSegment parseCutsceneImageSegment(const json& j);
|
|
static StaticCutsceneDefinition parseCutscene(const json& j);
|
|
};
|
|
|
|
} // namespace ZL::Cutscene
|