MCPcopy Create free account
hub / github.com/axmolengine/axmol / getObject

Method getObject

core/2d/TMXObjectGroup.cpp:45–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45ValueMap 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
64Value TMXObjectGroup::getProperty(std::string_view propertyName) const
65{

Callers

nothing calls this directly

Calls 5

asStringMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected