2023-03-14 22:27:46 -07:00

40 lines
977 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "util/XmlParser.hpp"
namespace Dawn {
struct SceneInformation {
std::string type;
std::string name;
};
class SceneParser : public XmlParser<struct SceneInformation> {
protected:
std::vector<std::string> getRequiredAttributes() {
return std::vector<std::string>{
"name",
};
}
std::map<std::string, std::string> getOptionalAttributes() {
return std::map<std::string, std::string>{
{ "type", "SimpleVNScene" }
};
}
int32_t onParse(
Xml *node,
std::map<std::string, std::string> values,
struct SceneInformation *out,
std::string *error
) {
out->name = values["name"];
out->type = values["type"];
return 0;
}
};
}