Dawn/archive/dawntools/prefabtool/PrefabParser.cpp
2023-10-31 21:15:03 -05:00

28 lines
671 B
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "PrefabParser.hpp"
using namespace Dawn;
std::vector<std::string> PrefabParser::getRequiredAttributes() {
return { "name", "type" };
}
std::map<std::string, std::string> PrefabParser::getOptionalAttributes() {
return { };
}
int32_t PrefabParser::onParse(
Xml *node,
std::map<std::string, std::string> values,
struct Prefab *out,
std::string *error
) {
out->name = values["name"];
out->type = values["type"];
out->root.registry = out->registry;
return (SceneItemParser()).parse(node, &out->root, error);
}