Dawn/src/dawntools/vnscenetool/VNSceneParser.cpp

44 lines
909 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "VNSceneParser.hpp"
using namespace Dawn;
std::vector<std::string> VNSceneParser::getRequiredAttributes() {
return { };
}
std::map<std::string, std::string> VNSceneParser::getOptionalAttributes() {
return { };
}
int32_t VNSceneParser::onParse(
Xml *node,
std::map<std::string, std::string> values,
struct VNScene *out,
std::string *error
) {
//
int32_t ret;
auto itChildren = node->children.begin();
while(itChildren != node->children.end()) {
Xml *child = *itChildren;
// Parse event(s)
if(child->node == "events") {
struct VNSceneEvent scene;
ret = (VNSceneEventsParser()).parse(child, &scene, error);
if(ret != 0) return ret;
out->events.push_back(scene);
}
itChildren++;
}
return 0;
}