BattleScene *BattleScene::create(const std::string &stage){ BattleScene *pRet = new (std::nothrow) BattleScene(stage); if (pRet && pRet->init()){ pRet->autorelease(); return pRet; } delete pRet; pRet = nullptr; return nullptr; }
BattleScene* BattleScene::create(PreloadBattleScene* preloaderScene, std::vector<int> parameters) { BattleScene* scene = new BattleScene(); if (scene && scene->init(preloaderScene, parameters)) { return (BattleScene*)scene->autorelease(); } CC_SAFE_DELETE(scene); return scene; }
BattleScene* BattleScene::create(int level) { BattleScene* battleScene = new BattleScene(); if (battleScene && battleScene->init(level)) { battleScene->autorelease(); } else { CC_SAFE_DELETE(battleScene); } return battleScene; }