Encapsulate identifier, guiName, and description into a PropertyInfo struct

This commit is contained in:
Alexander Bock
2017-07-22 17:36:03 -04:00
parent b584f0197e
commit 04bac9293b
76 changed files with 422 additions and 539 deletions

View File

@@ -78,9 +78,7 @@ int addVirtualProperty(lua_State* L) {
if (type == "BoolProperty") {
bool v = lua_toboolean(L, -3);
prop = std::make_unique<properties::BoolProperty>(
identifier,
name,
description,
properties::Property::PropertyInfo{ identifier, name, description },
v
);
}
@@ -90,9 +88,7 @@ int addVirtualProperty(lua_State* L) {
int max = static_cast<int>(lua_tonumber(L, -1));
prop = std::make_unique<properties::IntProperty>(
identifier,
name,
description,
properties::Property::PropertyInfo{ identifier, name, description },
v,
min,
max
@@ -104,9 +100,7 @@ int addVirtualProperty(lua_State* L) {
float max = static_cast<float>(lua_tonumber(L, -1));
prop = std::make_unique<properties::FloatProperty>(
identifier,
name,
description,
properties::Property::PropertyInfo{ identifier, name, description },
v,
min,
max
@@ -114,9 +108,7 @@ int addVirtualProperty(lua_State* L) {
}
else if (type == "TriggerProperty") {
prop = std::make_unique<properties::TriggerProperty>(
identifier,
name,
description
properties::Property::PropertyInfo{ identifier, name, description }
);
}
else {