| 43 | } |
| 44 | |
| 45 | ValueMap TMXObjectGroup::getObject(std::string_view objectName) const |
| 46 | { |
| 47 | if (!_objects.empty()) |
| 48 | { |
| 49 | for (const auto& v : _objects) |
| 50 | { |
| 51 | const ValueMap& dict = v.asValueMap(); |
| 52 | if (dict.find("name") != dict.end()) |
| 53 | { |
| 54 | if (dict.at("name").asString() == objectName) |
| 55 | return dict; |
| 56 | } |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | // object not found |
| 61 | return ValueMap(); |
| 62 | } |
| 63 | |
| 64 | Value TMXObjectGroup::getProperty(std::string_view propertyName) const |
| 65 | { |