Added C# -> Trenchbrom entity definition with reflection system

This commit is contained in:
Antoine Pilote
2024-08-30 21:44:08 -04:00
parent d46f74aa24
commit 85b41e9ea0
18 changed files with 439 additions and 107 deletions

View File

@@ -2,10 +2,10 @@
#include <string>
enum class ClassPropertyType {
String,
Integer,
Float,
Boolean,
String,
Float,
Integer,
AABB,
Choices,
Color,
@@ -20,4 +20,5 @@ struct ClassProperty {
std::string name;
ClassPropertyType type;
std::string description;
std::string value;
};

View File

@@ -112,8 +112,19 @@ namespace Nuake {
line += "(";
if (p.type == ClassPropertyType::Integer)
line += "integer";
if (p.type == ClassPropertyType::String)
line += "string";
line += ") : ";
line += "\"" + p.description + "\"";
line += " : ";
if (p.type == ClassPropertyType::String)
{
line += " \"" + p.value + "\" ";
}
else if (p.type == ClassPropertyType::Integer)
{
line += p.value;
}
line += "\n";
}