MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / HasPlayerAssignment

Function HasPlayerAssignment

apps/tools/Tools/commands/LintCommand.cpp:70–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70bool HasPlayerAssignment(const ParamEntry& entry)
71{
72 const ParamEntry* player = entry.FindEntryNoInheritance("player");
73 if (player)
74 {
75 RStringB value = player->GetValue();
76 if (!!value && value[0])
77 {
78 return true;
79 }
80 }
81
82 const ParamClass* cls = entry.GetClassInterface();
83 if (!cls)
84 {
85 return false;
86 }
87
88 for (int i = 0; i < cls->GetEntryCount(); ++i)
89 {
90 const ParamEntry& child = cls->GetEntry(i);
91 if (child.IsClass() && HasPlayerAssignment(child))
92 {
93 return true;
94 }
95 }
96
97 return false;
98}
99
100SectionLintResult LintMissionSection(const ParamFile& sqm, const char* sectionName)
101{

Callers 1

LintMissionSectionFunction · 0.85

Calls 5

GetClassInterfaceMethod · 0.80
GetValueMethod · 0.45
GetEntryCountMethod · 0.45
IsClassMethod · 0.45

Tested by

no test coverage detected