2012-04-19 14:35:52 +08:00
|
|
|
/****************************************************************************
|
2012-09-24 21:22:20 +08:00
|
|
|
Copyright (c) 2010-2012 cocos2d-x.org
|
2012-04-19 14:35:52 +08:00
|
|
|
Copyright (c) 2010 Neophit
|
|
|
|
Copyright (c) 2010 Ricardo Quesada
|
|
|
|
Copyright (c) 2011 Zynga Inc.
|
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef __CCTMX_OBJECT_GROUP_H__
|
|
|
|
#define __CCTMX_OBJECT_GROUP_H__
|
|
|
|
|
2012-06-19 13:50:11 +08:00
|
|
|
#include "cocoa/CCGeometry.h"
|
|
|
|
#include "cocoa/CCString.h"
|
|
|
|
#include "cocoa/CCArray.h"
|
|
|
|
#include "cocoa/CCDictionary.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
NS_CC_BEGIN
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
/**
|
|
|
|
* @addtogroup tilemap_parallax_nodes
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2013-06-20 14:13:12 +08:00
|
|
|
/** @brief TMXObjectGroup represents the TMX object group.
|
2012-04-19 14:35:52 +08:00
|
|
|
@since v0.99.0
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
class CC_DLL TMXObjectGroup : public Object
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
/** offset position of child objects */
|
2013-06-20 14:13:12 +08:00
|
|
|
CC_SYNTHESIZE_PASS_BY_REF(Point, _positionOffset, PositionOffset);
|
2012-04-19 14:35:52 +08:00
|
|
|
/** list of properties stored in a dictionary */
|
2013-06-20 14:13:12 +08:00
|
|
|
CC_PROPERTY(Dictionary*, _properties, Properties);
|
2012-04-19 14:35:52 +08:00
|
|
|
/** array of the objects */
|
2013-06-20 14:13:12 +08:00
|
|
|
CC_PROPERTY(Array*, _objects, Objects);
|
2012-04-19 14:35:52 +08:00
|
|
|
public:
|
2013-06-20 14:13:12 +08:00
|
|
|
TMXObjectGroup();
|
|
|
|
virtual ~TMXObjectGroup();
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
inline const char* getGroupName(){ return _groupName.c_str(); }
|
|
|
|
inline void setGroupName(const char *groupName){ _groupName = groupName; }
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
/** return the value for the specific property name */
|
2013-06-20 14:13:12 +08:00
|
|
|
String *propertyNamed(const char* propertyName);
|
2012-04-19 14:35:52 +08:00
|
|
|
|
|
|
|
/** return the dictionary for the specific object name.
|
|
|
|
It will return the 1st object found on the array for the given name.
|
|
|
|
*/
|
2013-06-20 14:13:12 +08:00
|
|
|
Dictionary* objectNamed(const char *objectName);
|
2012-04-19 14:35:52 +08:00
|
|
|
protected:
|
|
|
|
/** name of the group */
|
2013-06-15 14:03:30 +08:00
|
|
|
std::string _groupName;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
2012-06-20 18:09:11 +08:00
|
|
|
// end of tilemap_parallax_nodes group
|
|
|
|
/// @}
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
NS_CC_END
|
|
|
|
|
2010-08-30 11:45:46 +08:00
|
|
|
#endif //__CCTMX_OBJECT_GROUP_H__
|