ResultScene* ResultScene::createWithParam(int level, int minScore, int resultScore) { ResultScene *pRet = new ResultScene(); if (pRet && pRet->initWithParam(level,minScore,resultScore)) { pRet->autorelease(); return pRet; } else { delete pRet; pRet = NULL; return NULL; } }
Scene* ResultScene::createScene(std::vector<int> scores) { auto scene = Scene::create(); ResultScene *pRet = new ResultScene(); if (pRet && pRet->initWithScores(scores)) { pRet->autorelease(); } else { delete pRet; pRet = NULL; return NULL; } scene->addChild(pRet); return scene; }