コード例 #1
0
        protected void _CalcStage1()
        {
            if (_data.Air1 == null)
            {
                return;
            }
            Random random = new Random();

            if (_planes_f.Count > 0)
            {
                int count = _data.Air1.F_LostInfo.Count;
                int power = (int)Math.Floor((double)count / (double)_planes_f.Count);
                int extra = count % _planes_f.Count;
                for (int i = 0; i < _planes_f.Count; i++)
                {
                    _planes_f[i].SetStage1Power(power, ref extra);
                }
                int lost = _data.Air1.F_LostInfo.LostCount;
                while (lost > 0)
                {
                    List <PlaneModelBase> list = _planes_f.FindAll((PlaneModelBase plane) => plane.Power_Stage1End > 0);
                    if (list.Count > 0)
                    {
                        PlaneModelBase planeModelBase = list[random.Next(list.Count)];
                        planeModelBase.SetStage1Lost(ref lost);
                    }
                }
            }
            if (_planes_e.Count <= 0)
            {
                return;
            }
            int count2 = _data.Air1.E_LostInfo.Count;
            int power2 = (int)Math.Floor((double)count2 / (double)_planes_e.Count);
            int extra2 = count2 % _planes_e.Count;

            for (int j = 0; j < _planes_e.Count; j++)
            {
                _planes_e[j].SetStage1Power(power2, ref extra2);
            }
            int lost2 = _data.Air1.E_LostInfo.LostCount;

            while (lost2 > 0)
            {
                List <PlaneModelBase> list2 = _planes_e.FindAll((PlaneModelBase plane) => plane.Power_Stage1End > 0);
                if (list2.Count > 0)
                {
                    PlaneModelBase planeModelBase2 = list2[random.Next(list2.Count)];
                    planeModelBase2.SetStage1Lost(ref lost2);
                }
            }
        }
コード例 #2
0
        protected void _CalcStage1()
        {
            if (this._data.Air1 == null)
            {
                return;
            }
            Random random = new Random();

            if (this._planes_f.get_Count() > 0)
            {
                int count = this._data.Air1.F_LostInfo.Count;
                int power = (int)Math.Floor((double)count / (double)this._planes_f.get_Count());
                int num   = count % this._planes_f.get_Count();
                for (int i = 0; i < this._planes_f.get_Count(); i++)
                {
                    this._planes_f.get_Item(i).SetStage1Power(power, ref num);
                }
                int j = this._data.Air1.F_LostInfo.LostCount;
                while (j > 0)
                {
                    List <PlaneModelBase> list = this._planes_f.FindAll((PlaneModelBase plane) => plane.Power_Stage1End > 0);
                    if (list.get_Count() > 0)
                    {
                        PlaneModelBase planeModelBase = list.get_Item(random.Next(list.get_Count()));
                        planeModelBase.SetStage1Lost(ref j);
                    }
                }
            }
            if (this._planes_e.get_Count() > 0)
            {
                int count2 = this._data.Air1.E_LostInfo.Count;
                int power2 = (int)Math.Floor((double)count2 / (double)this._planes_e.get_Count());
                int num2   = count2 % this._planes_e.get_Count();
                for (int k = 0; k < this._planes_e.get_Count(); k++)
                {
                    this._planes_e.get_Item(k).SetStage1Power(power2, ref num2);
                }
                int l = this._data.Air1.E_LostInfo.LostCount;
                while (l > 0)
                {
                    List <PlaneModelBase> list2 = this._planes_e.FindAll((PlaneModelBase plane) => plane.Power_Stage1End > 0);
                    if (list2.get_Count() > 0)
                    {
                        PlaneModelBase planeModelBase2 = list2.get_Item(random.Next(list2.get_Count()));
                        planeModelBase2.SetStage1Lost(ref l);
                    }
                }
            }
        }