|
cocos2d-x
2.1.1
|
#include <CCArray.h>
Public Member Functions | |
| ~CCArray () | |
| bool | init () |
| Initializes an array. | |
| bool | initWithObject (CCObject *pObject) |
| Initializes an array with one object. | |
| bool | initWithObjects (CCObject *pObject,...) |
| Initializes an array with some objects. | |
| bool | initWithCapacity (unsigned int capacity) |
| Initializes an array with capacity. | |
| bool | initWithArray (CCArray *otherArray) |
| Initializes an array with an existing array. | |
| unsigned int | count () |
| Returns element count of the array. | |
| unsigned int | capacity () |
| Returns capacity of the array. | |
| unsigned int | indexOfObject (CCObject *object) |
| Returns index of a certain object, return UINT_MAX if doesn't contain the object. | |
| CCObject * | objectAtIndex (unsigned int index) |
| Returns an element with a certain index. | |
| CCObject * | lastObject () |
| Returns last element. | |
| CCObject * | randomObject () |
| Returns a random element. | |
| bool | containsObject (CCObject *object) |
| Returns a Boolean value that indicates whether object is present in array. | |
| bool | isEqualToArray (CCArray *pOtherArray) |
| void | addObject (CCObject *object) |
| Add a certain object. | |
| void | addObjectsFromArray (CCArray *otherArray) |
| Add all elements of an existing array. | |
| void | insertObject (CCObject *object, unsigned int index) |
| Insert a certain object at a certain index. | |
| void | removeLastObject (bool bReleaseObj=true) |
| Remove last object. | |
| void | removeObject (CCObject *object, bool bReleaseObj=true) |
| Remove a certain object. | |
| void | removeObjectAtIndex (unsigned int index, bool bReleaseObj=true) |
| Remove an element with a certain index. | |
| void | removeObjectsInArray (CCArray *otherArray) |
| Remove all elements. | |
| void | removeAllObjects () |
| Remove all objects. | |
| void | fastRemoveObject (CCObject *object) |
| Fast way to remove a certain object. | |
| void | fastRemoveObjectAtIndex (unsigned int index) |
| Fast way to remove an element with a certain index. | |
| void | exchangeObject (CCObject *object1, CCObject *object2) |
| Swap two elements. | |
| void | exchangeObjectAtIndex (unsigned int index1, unsigned int index2) |
| Swap two elements with certain indexes. | |
| void | replaceObjectAtIndex (unsigned int uIndex, CCObject *pObject, bool bReleaseObject=true) |
| Replace object at index with another object. | |
| void | reverseObjects () |
| Revers the array. | |
| void | reduceMemoryFootprint () |
| virtual CCObject * | copyWithZone (CCZone *pZone) |
| CCArray () | |
| CCArray (unsigned int capacity) | |
Public Member Functions inherited from CCObject | |
| CCObject (void) | |
| virtual | ~CCObject (void) |
| void | release (void) |
| void | retain (void) |
| CCObject * | autorelease (void) |
| CCObject * | copy (void) |
| bool | isSingleReference (void) |
| unsigned int | retainCount (void) |
| virtual bool | isEqual (const CCObject *pObject) |
| virtual void | update (float dt) |
Static Public Member Functions | |
| static CCArray * | create () |
| Create an array. | |
| static CCArray * | create (CCObject *pObject,...) |
| Create an array with some objects. | |
| static CCArray * | createWithObject (CCObject *pObject) |
| Create an array with one object. | |
| static CCArray * | createWithCapacity (unsigned int capacity) |
| Create an array with capacity. | |
| static CCArray * | createWithArray (CCArray *otherArray) |
| Create an array with an existing array. | |
| static CCArray * | createWithContentsOfFile (const char *pFileName) |
| Generate a CCArray pointer by file. | |
| static CCArray * | createWithContentsOfFileThreadSafe (const char *pFileName) |
Public Attributes | |
| ccArray * | data |
Public Attributes inherited from CCObject | |
| unsigned int | m_uID |
| int | m_nLuaID |
Additional Inherited Members | |
Protected Attributes inherited from CCObject | |
| unsigned int | m_uReference |
| unsigned int | m_uAutoReleaseCount |
Constructor & Destructor Documentation
| ~CCArray | ( | ) |
| CCArray | ( | ) |
| CCArray | ( | unsigned int | capacity | ) |
Member Function Documentation
| void addObject | ( | CCObject * | object | ) |
Add a certain object.
| void addObjectsFromArray | ( | CCArray * | otherArray | ) |
Add all elements of an existing array.
| unsigned int capacity | ( | ) |
Returns capacity of the array.
| bool containsObject | ( | CCObject * | object | ) |
Returns a Boolean value that indicates whether object is present in array.
| unsigned int count | ( | ) |
Returns element count of the array.
|
static |
Create an array.
Create an array with an existing array.
|
static |
Create an array with capacity.
|
static |
|
static |
| void exchangeObjectAtIndex | ( | unsigned int | index1, |
| unsigned int | index2 | ||
| ) |
Swap two elements with certain indexes.
| void fastRemoveObject | ( | CCObject * | object | ) |
Fast way to remove a certain object.
| void fastRemoveObjectAtIndex | ( | unsigned int | index | ) |
Fast way to remove an element with a certain index.
| unsigned int indexOfObject | ( | CCObject * | object | ) |
Returns index of a certain object, return UINT_MAX if doesn't contain the object.
| bool init | ( | ) |
Initializes an array.
| bool initWithArray | ( | CCArray * | otherArray | ) |
Initializes an array with an existing array.
| bool initWithCapacity | ( | unsigned int | capacity | ) |
Initializes an array with capacity.
| bool initWithObject | ( | CCObject * | pObject | ) |
Initializes an array with one object.
| bool initWithObjects | ( | CCObject * | pObject, |
| ... | |||
| ) |
Initializes an array with some objects.
| void insertObject | ( | CCObject * | object, |
| unsigned int | index | ||
| ) |
Insert a certain object at a certain index.
| bool isEqualToArray | ( | CCArray * | pOtherArray | ) |
- Since
- 1.1
| CCObject* lastObject | ( | ) |
Returns last element.
| CCObject* objectAtIndex | ( | unsigned int | index | ) |
Returns an element with a certain index.
| CCObject* randomObject | ( | ) |
Returns a random element.
| void reduceMemoryFootprint | ( | ) |
| void removeAllObjects | ( | ) |
Remove all objects.
| void removeLastObject | ( | bool | bReleaseObj = true | ) |
Remove last object.
| void removeObject | ( | CCObject * | object, |
| bool | bReleaseObj = true |
||
| ) |
Remove a certain object.
| void removeObjectAtIndex | ( | unsigned int | index, |
| bool | bReleaseObj = true |
||
| ) |
Remove an element with a certain index.
| void removeObjectsInArray | ( | CCArray * | otherArray | ) |
Remove all elements.
| void replaceObjectAtIndex | ( | unsigned int | uIndex, |
| CCObject * | pObject, | ||
| bool | bReleaseObject = true |
||
| ) |
Replace object at index with another object.
| void reverseObjects | ( | ) |
Revers the array.
Member Data Documentation
| ccArray* data |
The documentation for this class was generated from the following file:
- /Users/zhangkoumyou/SourceCode/cocos2d-x/cocos2dx/cocoa/CCArray.h

Public Member Functions inherited from 