本文整理汇总了C++中CCArray::size方法的典型用法代码示例。如果您正苦于以下问题:C++ CCArray::size方法的具体用法?C++ CCArray::size怎么用?C++ CCArray::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCArray
的用法示例。
在下文中一共展示了CCArray::size方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeTouchEndedObserver
void LHTouchMgr::removeTouchEndedObserver(CCObject* observer){
#if COCOS2D_VERSION >= 0x00020000
CCArray* keys = onTouchEndedOnSpriteOfTag.allKeys();
if(keys){
for(int i = 0; i < keys->count(); ++i){
LHObserverPair* pair = (LHObserverPair*)onTouchEndedOnSpriteOfTag.objectForKey(((CCInteger*)keys->objectAtIndex(i))->getValue());
if(pair->object == observer){
onTouchEndedOnSpriteOfTag.removeObjectForKey(((CCInteger*)keys->objectAtIndex(i))->getValue());
}
}
}
#else
std::vector<int> keys = onTouchEndedOnSpriteOfTag.allKeys();
for(int i = 0; i < keys.size(); ++i){
LHObserverPair* pair = (LHObserverPair*)onTouchEndedOnSpriteOfTag.objectForKey(keys[i]);
if(pair->object == observer){
onTouchEndedOnSpriteOfTag.removeObjectForKey(keys[i]);
}
}
#endif
}
示例2: RecurseDestroy
void RecurseDestroy(CCObject * pObj)
{
if (pObj == NULL) return;
if (pObj->isOfClass(CCObject::ClassOfCCDictionary))
{
CCDictionary * pDict = (CCDictionary *)pObj;
CCDictionary::const_iterator itDict = pDict->begin();
while(itDict != pDict->end())
{
RecurseDestroy(itDict->second);
itDict++;
}
pDict->erase(pDict->begin(), pDict->end());
V_SAFE_DELETE(pDict);
}
else if (pObj->isOfClass(CCObject::ClassOfCCArray))
{
CCArray * pArray = (CCArray *)pObj;
int iCount = (int)pArray->size();
for (int i = 0; i < iCount; i++)
{
RecurseDestroy((*pArray)[i]);
}
V_SAFE_DELETE(pArray);
}
else if (pObj->isOfClass(CCObject::ClassOfCCString))
{
CCString * pString = (CCString*)pObj;
V_SAFE_DELETE(pString);
}
else
{
V_SAFE_DELETE(pObj);
}
}
示例3: removeMarkedNodes
void LHSettings::removeMarkedNodes(){
#if COCOS2D_VERSION >= 0x00020000
CCArray* keys = markedNodes.allKeys();
if(keys){
for(int i = 0; i < keys->count(); ++i){
LHNode* node = (LHNode*)markedNodes.objectForKey(((CCString*)keys->objectAtIndex(i))->getCString());
removeMarkedNode(node);
}
}
markedNodes.removeAllObjects();
#else
std::vector<std::string> keys = markedNodes.allKeys();
for(int i = 0; i < keys.size(); ++i){
LHNode* node = (LHNode*)markedNodes.objectForKey(keys[i]);
removeMarkedNode(node);
}
markedNodes.removeAllObjects();
#endif
}