当前位置: 首页>>代码示例>>C++>>正文


C++ ActionObject::autorelease方法代码示例

本文整理汇总了C++中ActionObject::autorelease方法的典型用法代码示例。如果您正苦于以下问题:C++ ActionObject::autorelease方法的具体用法?C++ ActionObject::autorelease怎么用?C++ ActionObject::autorelease使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ActionObject的用法示例。


在下文中一共展示了ActionObject::autorelease方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: initWithBinary

 void ActionManagerEx::initWithBinary(const char* file,
                                      cocos2d::Ref *root,
                                      CocoLoader* cocoLoader,
                                      stExpCocoNode*	pCocoNode)
 {
     std::string path = file;
     ssize_t pos = path.find_last_of("/");
     std::string fileName = path.substr(pos+1,path.length());
     cocos2d::Vector<ActionObject*> actionList;
     
     stExpCocoNode *stChildArray = pCocoNode->GetChildArray(cocoLoader);
     stExpCocoNode *actionNode = nullptr;
     for (int i=0; i < pCocoNode->GetChildNum(); ++i) {
         std::string key = stChildArray[i].GetName(cocoLoader);
         if (key == "actionlist") {
             actionNode = &stChildArray[i];
             break;
         }
     }
     if (nullptr != actionNode)
     {
         int actionCount = actionNode->GetChildNum();
         for (int i = 0; i < actionCount; ++i) {
             ActionObject* action = new (std::nothrow) ActionObject();
             action->autorelease();
             
             action->initWithBinary(cocoLoader, &actionNode->GetChildArray(cocoLoader)[i], root);
             
             actionList.pushBack(action);
         }
     }
     _actionDic[fileName] = actionList;
     
 }
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:34,代码来源:CCActionManagerEx.cpp

示例2: initWithDictionary

void ActionManagerEx::initWithDictionary(const char* jsonName,const rapidjson::Value &dic, Ref* root)
{
	std::string path = jsonName;
	ssize_t pos = path.find_last_of("/");
	std::string fileName = path.substr(pos+1,path.length());
	cocos2d::Vector<ActionObject*> actionList;
	int actionCount = DICTOOL->getArrayCount_json(dic, "actionlist");
	for (int i=0; i<actionCount; i++) {
		ActionObject* action = new (std::nothrow) ActionObject();
		action->autorelease();
		const rapidjson::Value &actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i);
		action->initWithDictionary(actionDic,root);
		actionList.pushBack(action);
	}
	_actionDic[fileName] = actionList;
}
开发者ID:114393824,项目名称:Cocos2dxShader,代码行数:16,代码来源:CCActionManagerEx.cpp

示例3: initWithDictionary

void ActionManager::initWithDictionary(const char* jsonName,cs::CSJsonDictionary *dic,CCObject* root)
{
	std::string path = jsonName;
	int pos = path.find_last_of("/");
	std::string fileName = path.substr(pos+1,path.length());
	CCLOG("filename == %s",fileName.c_str());
	CCArray* actionList = CCArray::create();
	int actionCount = DICTOOL->getArrayCount_json(dic, "actionlist");
    for (int i=0; i<actionCount; i++) {
        ActionObject* action = new ActionObject();
		action->autorelease();
        cs::CSJsonDictionary* actionDic = DICTOOL->getDictionaryFromArray_json(dic, "actionlist", i);
        action->initWithDictionary(actionDic,root);
        actionList->addObject(action);
		CC_SAFE_DELETE(actionDic);
    }
	m_pActionDic->setObject(actionList, fileName);
}
开发者ID:vincentRain,项目名称:cocos2d-x-qt-2,代码行数:18,代码来源:CCActionManager.cpp


注:本文中的ActionObject::autorelease方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。