public Battle GetCurrentBattle(common.BattleType type, int battleid)
    {
        Battle b = null;

        switch (type)
        {
        case common.BattleType.Arena:
            b = ArenaManager.instance.GetArena((uint)battleid);
            break;

        case common.BattleType.Battleground:
            b = BattleGroundManager.instance.GetBattleGround((uint)battleid);
            break;

        case common.BattleType.Dungeon:
            b = DungeonManager.instance.GetDungeon((uint)battleid);
            break;

        case common.BattleType.World:
            b = SceneManager.instance.GetScene((uint)battleid);
            break;
        }

        return(b);
    }
Beispiel #2
0
    /// <summary>
    /// 创建新的战斗
    /// </summary>
    /// <param name="LevelID"></param>
    /// <param name="userRole"></param>
    public BattleDungeon Create(common.BattleType type, string mapName, int limitNumber)
    {
        BattleDungeon level = new BattleDungeon();

        level.Init(type, mapName, limitNumber);

        level.globalID = _idcounter++;

        _battles.Add(_idcounter, level);

        return(level);
    }