Esempio n. 1
0
// 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;
}
Esempio n. 2
0
// 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;
}