예제 #1
0
        /// <summary>
        /// 设置分组
        /// </summary>
        /// <param name="g"></param>
        private void SetGroup(List <DBUnionBattleGroupData> g)
        {
            var groupList = DiviveIntoGroups();

            g.Clear();
            foreach (var group in groupList)
            {
                for (var i = 0; i < group.Count / 2; ++i)
                {
                    var data = new DBUnionBattleGroupData();
                    data.Id1 = group[i * 2];
                    data.Id2 = group[i * 2 + 1];
                    g.Add(data);
                }
            }
        }
예제 #2
0
        public void ChangeStage(UnionBattleStage stage)
        {
            UnionBattleManager.mDBData.Stage = (int)stage;

            if (stage == UnionBattleStage.Breakout1)
            {
                SetGroup(UnionBattleManager.mDBData.Group1);
            }
            else if (stage == UnionBattleStage.Breakout2)
            {
                SetGroup(UnionBattleManager.mDBData.Group2);
            }
            else if (stage == UnionBattleStage.Breakout3)
            {
                SetGroup(UnionBattleManager.mDBData.Group3);
            }
            else if (stage == UnionBattleStage.Breakout4)
            {
                SetGroup(UnionBattleManager.mDBData.Group4);
            }
            else if (stage == UnionBattleStage.Quarterfinal)
            {
                var groupList = DiviveIntoGroups();
                foreach (var group in groupList)
                { // 取第一组进决赛
                    for (var i = 0; i < group.Count / 2; ++i)
                    {
                        var data = new DBUnionBattleGroupData();
                        data.Id1 = group[i * 2];
                        data.Id2 = group[i * 2 + 1];
                        UnionBattleManager.mDBData.FinalGroup.Add(data);
                    }
                    break;
                }
            }
            else if (stage == UnionBattleStage.Over)
            {
                BattleOver();
            }
            if (stage != UnionBattleStage.Over)
            {
                CreateTrigger();
            }

            UnionBattleManager.Dirty = true;
        }