コード例 #1
0
ファイル: BattleScene.cpp プロジェクト: 13609594236/ph-open
// PvP Recovery
BattleScene* BattleScene::create(int seed,
                                 int round,
                                 const Player& first,
                                 const Player& second,
                                 const rapidjson::Value& battleState,
                                 float skillTimeout,
                                 float moveTimeout,
                                 float skillTimeLeft,
                                 float moveTimeLeft,
                                 const rapidjson::Value& events)
{
    BattleScene* scene = new BattleScene();
    
    if(scene && scene->initPvP(seed,
                               round,
                               first,
                               second,
                               battleState,
                               skillTimeout,
                               moveTimeout,
                               skillTimeLeft,
                               moveTimeLeft,
                               events))
    {
        scene->autorelease();
        return scene;
    }
    CC_SAFE_DELETE(scene);
    return NULL;
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: BattleScene.cpp プロジェクト: 13609594236/ph-open
// PvP
BattleScene* BattleScene::create(const Player& p1, const Player& p2, const PvPConfig& config)
{
    BattleScene* scene = new BattleScene();

    if(scene && scene->initPvP(p1, p2, config))
    {
        scene->autorelease();
        return scene;
    }
    CC_SAFE_DELETE(scene);
    return NULL;
}
コード例 #4
0
ファイル: BattleScene.cpp プロジェクト: 13609594236/ph-open
// PvE
BattleScene* BattleScene::create(HeroList& team, LevelInfo& level)
{
    BattleScene* scene = new BattleScene();
    
    if(scene && scene->initWithLevel(team, level))
    {
        scene->autorelease();
        return scene;
    }
    CC_SAFE_DELETE(scene);
    return NULL;
}
コード例 #5
0
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;
}
コード例 #6
0
BattleScene* BattleScene::create(int level)
{
	BattleScene* battleScene = new BattleScene();
	if (battleScene && battleScene->init(level))
	{
		battleScene->autorelease();
	}
	else
	{
		CC_SAFE_DELETE(battleScene);
	}
	return battleScene;
}