Dawn/archive/dawntools/util/parser/SceneItemComponentRegistry.hpp
2023-10-31 21:15:03 -05:00

41 lines
1.1 KiB
C++

// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "util/DawnTool.hpp"
#include "util/Directory.hpp"
#include "util/XmlParser.hpp"
#include "util/CodeGen.hpp"
#include "util/string.hpp"
#include <regex>
namespace Dawn {
struct SceneItemComponentRuleset {
std::string name;
std::string include;
std::map<std::string, std::string> selfOptional;
std::map<std::string, std::string> innerXml;
std::map<std::string, std::string> optional;
std::vector<std::string> extends;
};
struct SceneItemComponentRegistry {
std::string sources;
std::map<std::string, struct SceneItemComponentRuleset> rulesets;
struct SceneItemComponentRuleset parseFile(
File *file,
std::string clazz
);
/**
* Gets a prefab component ruleset for a specific scene item component type.
*
* @param type Scene Item Component Type to get ruleset for.
* @return The found ruleset, or an empty ruleset if not found.
*/
struct SceneItemComponentRuleset getRuleset(std::string type);
};
}