Working on Prefab Parser updates
This commit is contained in:
@ -4,46 +4,9 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "util/DawnTool.hpp"
|
||||
#include "util/Directory.hpp"
|
||||
#include "util/XmlParser.hpp"
|
||||
#include "util/CodeGen.hpp"
|
||||
#include <regex>
|
||||
#include "PrefabParser.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
enum PrefabcComponentParserRulesetType {
|
||||
STRIN
|
||||
};
|
||||
|
||||
struct PrefabComponentParserRuleset {
|
||||
std::string name;
|
||||
std::string include;
|
||||
std::map<std::string, std::string> optional;
|
||||
};
|
||||
|
||||
struct PrefabRegistry {
|
||||
std::string sources;
|
||||
|
||||
struct PrefabComponentParserRuleset getRuleset(std::string type);
|
||||
};
|
||||
|
||||
struct PrefabComponent {
|
||||
struct PrefabRegistry *registry;
|
||||
|
||||
std::string include;
|
||||
std::string type;
|
||||
std::map<std::string, std::string> values;
|
||||
std::string ref;
|
||||
};
|
||||
|
||||
struct Prefab {
|
||||
struct PrefabRegistry *registry;
|
||||
|
||||
std::string name;
|
||||
std::string type;
|
||||
std::vector<struct PrefabComponent> components;
|
||||
};
|
||||
|
||||
class PrefabTool : public DawnTool {
|
||||
protected:
|
||||
std::vector<std::string> getRequiredFlags() override;
|
||||
@ -53,30 +16,6 @@ namespace Dawn {
|
||||
int32_t start();
|
||||
};
|
||||
|
||||
class PrefabParser : public XmlParser<struct Prefab> {
|
||||
protected:
|
||||
std::vector<std::string> getRequiredAttributes() override;
|
||||
std::map<std::string, std::string> getOptionalAttributes() override;
|
||||
int32_t onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
struct Prefab *out,
|
||||
std::string *error
|
||||
) override;
|
||||
};
|
||||
|
||||
class PrefabComponentParser : public XmlParser<struct PrefabComponent> {
|
||||
protected:
|
||||
std::vector<std::string> getRequiredAttributes() override;
|
||||
std::map<std::string, std::string> getOptionalAttributes() override;
|
||||
int32_t onParse(
|
||||
Xml *node,
|
||||
std::map<std::string, std::string> values,
|
||||
struct PrefabComponent *out,
|
||||
std::string *error
|
||||
) override;
|
||||
};
|
||||
|
||||
class PrefabGen : public CodeGen {
|
||||
public:
|
||||
static void generate(
|
||||
|
Reference in New Issue
Block a user