public EffectModel GetEffectData(int index)
 {
     if (this._cache_cmd_actions != null && index < this._cache_cmd_actions.get_Count())
     {
         CmdActionPhaseModel cmdActionPhaseModel = this._cache_cmd_actions.get_Item(index);
         if (cmdActionPhaseModel != null && cmdActionPhaseModel.Effect != null)
         {
             return(cmdActionPhaseModel.Effect);
         }
     }
     return(null);
 }
Exemplo n.º 2
0
 public EffectModel GetEffectData(int index)
 {
     if (_cache_cmd_actions != null && index < _cache_cmd_actions.Count)
     {
         CmdActionPhaseModel cmdActionPhaseModel = _cache_cmd_actions[index];
         if (cmdActionPhaseModel != null && cmdActionPhaseModel.Effect != null)
         {
             return(cmdActionPhaseModel.Effect);
         }
     }
     return(null);
 }
 private ShipModel_Battle _GetFirstActionShip(int order)
 {
     if (order <= 0)
     {
         if (this.IsExistKoukuuData())
         {
             ShipModel_Battle firstActionShip = this.GetKoukuuData().GetFirstActionShip();
             if (firstActionShip != null)
             {
                 return(firstActionShip);
             }
         }
         if (this.IsExistShienData())
         {
             return(null);
         }
         if (this.IsExistKaimakuData())
         {
             ShipModel_Battle firstActionShip2 = this.GetKaimakuData().GetFirstActionShip();
             if (firstActionShip2 != null)
             {
                 return(firstActionShip2);
             }
         }
         if (this.GetEffectData(0) != null)
         {
             return(null);
         }
     }
     if (order <= 1)
     {
         CmdActionPhaseModel hougekiData_Day = this.GetHougekiData_Day(0);
         if (hougekiData_Day != null)
         {
             ShipModel_Battle firstActionShip3 = hougekiData_Day.GetFirstActionShip();
             if (firstActionShip3 != null)
             {
                 return(firstActionShip3);
             }
             if (this.GetEffectData(1) != null)
             {
                 return(null);
             }
         }
     }
     if (order <= 2)
     {
         CmdActionPhaseModel hougekiData_Day2 = this.GetHougekiData_Day(1);
         if (hougekiData_Day2 != null)
         {
             ShipModel_Battle firstActionShip4 = hougekiData_Day2.GetFirstActionShip();
             if (firstActionShip4 != null)
             {
                 return(firstActionShip4);
             }
             if (this.GetEffectData(2) != null)
             {
                 return(null);
             }
         }
     }
     if (order <= 3)
     {
         CmdActionPhaseModel hougekiData_Day3 = this.GetHougekiData_Day(2);
         if (hougekiData_Day3 != null)
         {
             ShipModel_Battle firstActionShip5 = hougekiData_Day3.GetFirstActionShip();
             if (firstActionShip5 != null)
             {
                 return(firstActionShip5);
             }
             if (this.GetEffectData(3) != null)
             {
                 return(null);
             }
         }
     }
     if (order <= 4)
     {
         CmdActionPhaseModel hougekiData_Day4 = this.GetHougekiData_Day(3);
         if (hougekiData_Day4 != null)
         {
             ShipModel_Battle firstActionShip6 = hougekiData_Day4.GetFirstActionShip();
             if (firstActionShip6 != null)
             {
                 return(firstActionShip6);
             }
             if (this.GetEffectData(4) != null)
             {
                 return(null);
             }
         }
     }
     if (order <= 5)
     {
         CmdActionPhaseModel hougekiData_Day5 = this.GetHougekiData_Day(4);
         if (hougekiData_Day5 != null)
         {
             ShipModel_Battle firstActionShip7 = hougekiData_Day5.GetFirstActionShip();
             if (firstActionShip7 != null)
             {
                 return(firstActionShip7);
             }
         }
         if (this.IsExistRaigekiData())
         {
             ShipModel_Battle firstActionShip7 = this.GetRaigekiData().GetFirstActionShip();
             if (firstActionShip7 != null)
             {
                 return(firstActionShip7);
             }
         }
         if (this.IsExistKoukuuData2())
         {
             ShipModel_Battle firstActionShip7 = this.GetKoukuuData2().GetFirstActionShip();
             if (firstActionShip7 != null)
             {
                 return(firstActionShip7);
             }
         }
     }
     return(null);
 }
 public void __createCacheDataAfterCommand__()
 {
     if (this._phase != CombatPhase.DAY)
     {
         return;
     }
     if (!this.IsTakeCommand())
     {
         return;
     }
     this._cache_opening_effect = null;
     if (this._battleData.DayBattle.OpeningProduction != null)
     {
         this._cache_opening_effect = new __EffectModel__(this._battleData.DayBattle.OpeningProduction);
     }
     this._cache_kouku = null;
     if (this._battleData.DayBattle.AirBattle != null)
     {
         int count  = this._battleData.DayBattle.AirBattle.F_PlaneFrom.get_Count();
         int count2 = this._battleData.DayBattle.AirBattle.E_PlaneFrom.get_Count();
         if (count > 0 || count2 > 0)
         {
             this._cache_kouku = new KoukuuModel(this._ships_f, this._ships_e, this._battleData.DayBattle.AirBattle);
         }
     }
     this._cache_shien = null;
     if (this._battleData.DayBattle.SupportAtack != null)
     {
         SupportAtack       supportAtack = this._battleData.DayBattle.SupportAtack;
         int                deck_Id      = supportAtack.Deck_Id;
         DeckModel          deck         = base.UserInfo.GetDeck(deck_Id);
         BattleSupportKinds supportType  = supportAtack.SupportType;
         if (supportType == BattleSupportKinds.AirAtack)
         {
             this._cache_shien = new ShienModel_Air(deck, this._ships_f, this._ships_e, supportAtack);
         }
         else if (supportType == BattleSupportKinds.Hougeki)
         {
             this._cache_shien = new ShienModel_Hou(deck, this._ships_f, this._ships_e, supportAtack);
         }
         else if (supportType == BattleSupportKinds.Raigeki)
         {
             this._cache_shien = new ShienModel_Rai(deck, this._ships_f, this._ships_e, supportAtack);
         }
     }
     this._cache_kaimaku = null;
     if (this._battleData.DayBattle.OpeningAtack != null)
     {
         this._cache_kaimaku = new RaigekiModel(this._ships_f, this._ships_e, this._battleData.DayBattle.OpeningAtack);
         if (this._cache_kaimaku.Count_f == 0 && this._cache_kaimaku.Count_e == 0)
         {
             this._cache_kaimaku = null;
         }
     }
     this._cache_cmd_actions = null;
     if (this._battleData.DayBattle.FromMiddleDayBattle != null)
     {
         this._cache_cmd_actions = new List <CmdActionPhaseModel>();
         Dictionary <int, ShipModel_BattleAll> ships = this._GetShipsDic();
         for (int i = 0; i < this._battleData.DayBattle.FromMiddleDayBattle.get_Count(); i++)
         {
             FromMiddleBattleDayData data = this._battleData.DayBattle.FromMiddleDayBattle.get_Item(i);
             CmdActionPhaseModel     cmdActionPhaseModel = new CmdActionPhaseModel(data, ships);
             this._cache_cmd_actions.Add(cmdActionPhaseModel);
         }
         if (this._cache_cmd_actions.TrueForAll((CmdActionPhaseModel model) => model == null || !model.HasAction()))
         {
             this._cache_cmd_actions = null;
         }
         else if (this._cache_cmd_actions.get_Count() == 0)
         {
             this._cache_cmd_actions = null;
         }
     }
     this._cache_raigeki = null;
     if (this._battleData.DayBattle.Raigeki != null)
     {
         this._cache_raigeki = new RaigekiModel(this._ships_f, this._ships_e, this._battleData.DayBattle.Raigeki);
         if (this._cache_raigeki.Count_f == 0 && this._cache_raigeki.Count_e == 0)
         {
             this._cache_raigeki = null;
         }
     }
     this._cache_kouku2 = null;
     if (this._battleData.DayBattle.AirBattle2 != null)
     {
         int count3 = this._battleData.DayBattle.AirBattle2.F_PlaneFrom.get_Count();
         int count4 = this._battleData.DayBattle.AirBattle2.E_PlaneFrom.get_Count();
         if (count3 > 0 || count4 > 0)
         {
             this._cache_kouku2 = new KoukuuModel(this._ships_f, this._ships_e, this._battleData.DayBattle.AirBattle2);
         }
     }
     if (this._cache_opening_effect != null)
     {
         ShipModel_Battle nextActionShip = this._GetFirstActionShip(0);
         ((__EffectModel__)this._cache_opening_effect).SetNextActionShip(nextActionShip);
     }
     if (this._cache_cmd_actions != null)
     {
         for (int j = 0; j < this._cache_cmd_actions.get_Count(); j++)
         {
             CmdActionPhaseModel cmdActionPhaseModel2 = this._cache_cmd_actions.get_Item(j);
             if (cmdActionPhaseModel2 != null && cmdActionPhaseModel2.Effect != null)
             {
                 ShipModel_Battle nextActionShip = this._GetFirstActionShip(j + 1);
                 ((__EffectModel__)cmdActionPhaseModel2.Effect).SetNextActionShip(nextActionShip);
             }
         }
     }
 }
Exemplo n.º 5
0
        public void __createCacheDataAfterCommand__()
        {
            if (_phase != 0 || !IsTakeCommand())
            {
                return;
            }
            _cache_opening_effect = null;
            if (_battleData.DayBattle.OpeningProduction != null)
            {
                _cache_opening_effect = new __EffectModel__(_battleData.DayBattle.OpeningProduction);
            }
            _cache_kouku = null;
            if (_battleData.DayBattle.AirBattle != null)
            {
                int count  = _battleData.DayBattle.AirBattle.F_PlaneFrom.Count;
                int count2 = _battleData.DayBattle.AirBattle.E_PlaneFrom.Count;
                if (count > 0 || count2 > 0)
                {
                    _cache_kouku = new KoukuuModel(_ships_f, _ships_e, _battleData.DayBattle.AirBattle);
                }
            }
            _cache_shien = null;
            if (_battleData.DayBattle.SupportAtack != null)
            {
                SupportAtack supportAtack = _battleData.DayBattle.SupportAtack;
                int          deck_Id      = supportAtack.Deck_Id;
                DeckModel    deck         = base.UserInfo.GetDeck(deck_Id);
                switch (supportAtack.SupportType)
                {
                case BattleSupportKinds.AirAtack:
                    _cache_shien = new ShienModel_Air(deck, _ships_f, _ships_e, supportAtack);
                    break;

                case BattleSupportKinds.Hougeki:
                    _cache_shien = new ShienModel_Hou(deck, _ships_f, _ships_e, supportAtack);
                    break;

                case BattleSupportKinds.Raigeki:
                    _cache_shien = new ShienModel_Rai(deck, _ships_f, _ships_e, supportAtack);
                    break;
                }
            }
            _cache_kaimaku = null;
            if (_battleData.DayBattle.OpeningAtack != null)
            {
                _cache_kaimaku = new RaigekiModel(_ships_f, _ships_e, _battleData.DayBattle.OpeningAtack);
                if (_cache_kaimaku.Count_f == 0 && _cache_kaimaku.Count_e == 0)
                {
                    _cache_kaimaku = null;
                }
            }
            _cache_cmd_actions = null;
            if (_battleData.DayBattle.FromMiddleDayBattle != null)
            {
                _cache_cmd_actions = new List <CmdActionPhaseModel>();
                Dictionary <int, ShipModel_BattleAll> ships = _GetShipsDic();
                for (int i = 0; i < _battleData.DayBattle.FromMiddleDayBattle.Count; i++)
                {
                    FromMiddleBattleDayData data = _battleData.DayBattle.FromMiddleDayBattle[i];
                    CmdActionPhaseModel     item = new CmdActionPhaseModel(data, ships);
                    _cache_cmd_actions.Add(item);
                }
                if (_cache_cmd_actions.TrueForAll((CmdActionPhaseModel model) => model == null || !model.HasAction()))
                {
                    _cache_cmd_actions = null;
                }
                else if (_cache_cmd_actions.Count == 0)
                {
                    _cache_cmd_actions = null;
                }
            }
            _cache_raigeki = null;
            if (_battleData.DayBattle.Raigeki != null)
            {
                _cache_raigeki = new RaigekiModel(_ships_f, _ships_e, _battleData.DayBattle.Raigeki);
                if (_cache_raigeki.Count_f == 0 && _cache_raigeki.Count_e == 0)
                {
                    _cache_raigeki = null;
                }
            }
            _cache_kouku2 = null;
            if (_battleData.DayBattle.AirBattle2 != null)
            {
                int count3 = _battleData.DayBattle.AirBattle2.F_PlaneFrom.Count;
                int count4 = _battleData.DayBattle.AirBattle2.E_PlaneFrom.Count;
                if (count3 > 0 || count4 > 0)
                {
                    _cache_kouku2 = new KoukuuModel(_ships_f, _ships_e, _battleData.DayBattle.AirBattle2);
                }
            }
            if (_cache_opening_effect != null)
            {
                ShipModel_Battle nextActionShip = _GetFirstActionShip(0);
                ((__EffectModel__)_cache_opening_effect).SetNextActionShip(nextActionShip);
            }
            if (_cache_cmd_actions == null)
            {
                return;
            }
            for (int j = 0; j < _cache_cmd_actions.Count; j++)
            {
                CmdActionPhaseModel cmdActionPhaseModel = _cache_cmd_actions[j];
                if (cmdActionPhaseModel != null && cmdActionPhaseModel.Effect != null)
                {
                    ShipModel_Battle nextActionShip = _GetFirstActionShip(j + 1);
                    ((__EffectModel__)cmdActionPhaseModel.Effect).SetNextActionShip(nextActionShip);
                }
            }
        }