Skip to content

Commit

Permalink
daEditorE: renamed member 'requires' into 'reqs'
Browse files Browse the repository at this point in the history
  • Loading branch information
NicSavichev committed Jan 17, 2024
1 parent 5298f6b commit 9ea39d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ class EntityObjEditor : public ObjectEditor, public console::ICommandProcessor
struct TemplatesGroup
{
eastl::string name;
eastl::vector<eastl::string>
requires;
eastl::vector<eastl::string> reqs;
eastl::vector<eastl::pair<eastl::string, eastl::string>> variants;
};
eastl::vector<TemplatesGroup> orderedTemplatesGroups;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1177,9 +1177,7 @@ void EntityObjEditor::addTemplatesGroupRequire(const char *group_name, const cha
[&group_name](const TemplatesGroup &group) { return group.name == group_name; });
TemplatesGroup &group = (it != orderedTemplatesGroups.end()) ? *it : orderedTemplatesGroups.push_back();
group.name = group_name;
group.
requires
.push_back(require);
group.reqs.push_back(require);
}

void EntityObjEditor::addTemplatesGroupVariant(const char *group_name, const char *variant)
Expand Down Expand Up @@ -1267,7 +1265,7 @@ bool EntityObjEditor::testEcsTemplateCondition(const ecs::Template &ecs_template
{
if (&checkgroup == &group)
break;
if (checkgroup.requires.empty() && checkgroup.variants.empty())
if (checkgroup.reqs.empty() && checkgroup.variants.empty())
continue;
if (testEcsTemplateByTemplatesGroup(ecs_template, nullptr, checkgroup, 1))
{
Expand Down Expand Up @@ -1332,7 +1330,7 @@ bool EntityObjEditor::testEcsTemplateByTemplatesGroup(const ecs::Template &ecs_t
if (!ecs_template.canInstantiate())
return false;

for (auto &condition : group.requires)
for (auto &condition : group.reqs)
if (!testEcsTemplateCondition(ecs_template, condition, group, depth))
return false;

Expand Down Expand Up @@ -1388,7 +1386,7 @@ Sqrat::Array EntityObjEditor::getEcsTemplates(HSQUIRRELVM vm)
templates.reserve(db.size());

bool filterNonCreatable = true;
if (pTemplatesGroup && !pTemplatesGroup->requires.empty() && pTemplatesGroup->requires[0] == "~noncreatable")
if (pTemplatesGroup && !pTemplatesGroup->reqs.empty() && pTemplatesGroup->reqs[0] == "~noncreatable")
filterNonCreatable = false;

eastl::vector<eastl::string> variants;
Expand Down

0 comments on commit 9ea39d7

Please sign in to comment.