123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include "2d/CCTMXObjectGroup.h"
- #include "base/ccMacros.h"
- NS_CC_BEGIN
- TMXObjectGroup::TMXObjectGroup()
- : _groupName("")
- {
- }
- TMXObjectGroup::~TMXObjectGroup()
- {
- CCLOGINFO("deallocing TMXObjectGroup: %p", this);
- }
- ValueMap TMXObjectGroup::getObject(const std::string& objectName) const
- {
- if (!_objects.empty())
- {
- for (const auto& v : _objects)
- {
- const ValueMap& dict = v.asValueMap();
- if (dict.find("name") != dict.end())
- {
- if (dict.at("name").asString() == objectName)
- return dict;
- }
- }
- }
-
-
- return ValueMap();
- }
- Value TMXObjectGroup::getProperty(const std::string& propertyName) const
- {
- if (_properties.find(propertyName) != _properties.end())
- return _properties.at(propertyName);
- return Value();
- }
- NS_CC_END
|