MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / hasFeature

Method hasFeature

radiantcore/settings/Game.cpp:91–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool Game::hasFeature(const std::string& feature) const
92{
93 xml::NodeList nodes = getLocalXPath("/features");
94 if (nodes.empty())
95 return false;
96
97 // Find the first available feature which matches the query feature
98 xml::NodeList features = nodes[0].getNamedChildren("feature");
99 for (const auto& f: features) {
100 if (f.getContent() == feature)
101 return true;
102 }
103
104 // Nothing found, so the optional feature isn't present
105 return false;
106}
107
108xml::NodeList Game::getLocalXPath(const std::string& localPath) const
109{

Callers 3

CreateFromNodeMethod · 0.80
TEST_FFunction · 0.80
initialiseModuleMethod · 0.80

Calls 3

getNamedChildrenMethod · 0.80
getContentMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected