| 89 | } |
| 90 | |
| 91 | bool 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 | |
| 108 | xml::NodeList Game::getLocalXPath(const std::string& localPath) const |
| 109 | { |
no test coverage detected