Almost done with new language tools
This commit is contained in:
40
src/dawntools/tools/vnscenegen/parse/scene.hpp
Normal file
40
src/dawntools/tools/vnscenegen/parse/scene.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
// 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;
|
||||
}
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user