Class CCArray

#include <Geode/cocos/cocoa/CCArray.h>
classCCArray:publiccocos2d::CCObject{ ... }
No description provided
Examples0
Public static methods7
staticcocos2d::CCArray*create()

Create an array

staticcocos2d::CCArray*create()

Create an array with some objects

staticcocos2d::CCArray*createWithObject()

Create an array with one object

staticcocos2d::CCArray*createWithCapacity(
uintcapacity
)

Create an array with capacity

staticcocos2d::CCArray*createWithArray()

Create an array with an existing array

staticcocos2d::CCArray*createWithContentsOfFile(
charconst*pFileName
)

Generate a CCArray pointer by file

Parameters

pFileName

The file name of *.plist file
Return value
The CCArray pointer generated from the file
staticcocos2d::CCArray*createWithContentsOfFileThreadSafe(
charconst*pFileName
)
No description provided
Public member functions39
boolinit()

Initializes an array

boolinitWithObject()

Initializes an array with one object

boolinitWithObjects()

Initializes an array with some objects

boolinitWithCapacity(
uintcapacity
)

Initializes an array with capacity

boolinitWithArray()

Initializes an array with an existing array

uintcount()const

Returns element count of the array

uintcapacity()const

Returns capacity of the array

uintindexOfObject()const

Returns index of a certain object, return UINT_MAX if doesn’t contain the object

cocos2d::CCObject*objectAtIndex(
uintindex
)

Returns an element with a certain index

cocos2d::CCString*stringAtIndex(
uintindex
)

Rob modification Returns an element with a certain index casted to CCString

cocos2d::CCObject*firstObject()

Returns first element, or null if empty

ℹ Geode addition

cocos2d::CCObject*lastObject()

Returns last element

cocos2d::CCObject*randomObject()

Returns a random element

boolcontainsObject()const

Returns a Boolean value that indicates whether object is present in array.

boolisEqualToArray()

Since 1.1

No description provided
voidaddObject()

Add a certain object

voidaddObjectNew()

Rob modification Add a certain object

voidaddObjectsFromArray()

Add all elements of an existing array

voidinsertObject(,
uintindex
)

Insert a certain object at a certain index

voidremoveFirstObject(
boolbReleaseObj
)

Remove first object, or do nothing if array is empty

ℹ Geode addition

voidremoveLastObject(
boolbReleaseObj
)

Remove last object

voidremoveObject(,
boolbReleaseObj
)

Remove a certain object

voidremoveObjectAtIndex(
uintindex
,
boolbReleaseObj
)

Remove an element with a certain index

voidremoveObjectsInArray()

Remove all elements

voidremoveAllObjects()

Remove all objects

voidfastRemoveObject()

Fast way to remove a certain object

voidfastRemoveObjectAtIndex(
uintindex
)

Fast way to remove an element with a certain index

voidfastRemoveObjectAtIndexNew(
uintindex
)

Fast way to remove an element with a certain index

ℹ RobTop addition

voidfastRemoveObjectAtIndexChild()
No description provided
voidrecreateNewIndexes()
No description provided
voidremoveObjectAtIndexChild(,)
No description provided
voidexchangeObject(,)

Swap two elements

voidexchangeObjectAtIndex(
uintindex1
,
uintindex2
)

Swap two elements with certain indexes

voidreplaceObjectAtIndex(
uintuIndex
,,
boolbReleaseObject
)

Replace object at index with another object.

voidreverseObjects()

Revers the array

voidreduceMemoryFootprint()
No description provided
virtualcocos2d::CCObject*copyWithZone()

override functions

cocos2d::CCArray*shallowCopy()

Creates a shallow copy of this array, aka only clones the pointers to the array members and not the members themselves

Return value
New array with same members
virtualvoidacceptVisitor()
No description provided
Fields1
;
No description provided
Protected member functions0
Protected fields0