56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
// Copyright (c) 2023 Dominic Masters
|
|
//
|
|
// This software is released under the MIT License.
|
|
// https://opensource.org/licenses/MIT
|
|
|
|
#pragma once
|
|
#include "util/XmlParser.hpp"
|
|
#include "util/CodeGen.hpp"
|
|
|
|
namespace Dawn {
|
|
struct AssetInformation {
|
|
std::string type;
|
|
std::string name;
|
|
};
|
|
|
|
class AssetParser : public XmlParser<struct AssetInformation> {
|
|
protected:
|
|
std::vector<std::string> getRequiredAttributes() {
|
|
return std::vector<std::string>{
|
|
"name",
|
|
"type"
|
|
};
|
|
}
|
|
|
|
std::map<std::string, std::string> getOptionalAttributes() {
|
|
return std::map<std::string, std::string>();
|
|
}
|
|
|
|
int32_t onParse(
|
|
Xml *node,
|
|
std::map<std::string, std::string> values,
|
|
struct AssetInformation *out,
|
|
std::string *error
|
|
) {
|
|
out->name = values["name"];
|
|
out->type = values["type"];
|
|
return 0;
|
|
}
|
|
|
|
std::string convert(struct AssetInformation info) {
|
|
std::string out;
|
|
return out;
|
|
}
|
|
};
|
|
|
|
class AssetGen : public CodeGen {
|
|
public:
|
|
static void generate(
|
|
std::vector<std::string> *out,
|
|
struct AssetInformation *info,
|
|
std::string tabs
|
|
) {
|
|
return line(out, "// Asset will be generated here", tabs);
|
|
}
|
|
};
|
|
} |