public RationModel(List <ShipModel_BattleAll> ships_f, Dictionary <int, List <Mst_slotitem> > data)
 {
     this._ships  = new List <ShipModel_Eater>();
     this._shared = new List <ShipModel_Eater>();
     for (int i = 0; i < ships_f.get_Count(); i++)
     {
         ShipModel_BattleAll shipModel_BattleAll = ships_f.get_Item(i);
         if (shipModel_BattleAll != null && data.ContainsKey(shipModel_BattleAll.TmpId))
         {
             ShipModel_Eater shipModel_Eater = shipModel_BattleAll.__CreateEater__();
             if (i > 0)
             {
                 ShipModel_Eater shipModel_Eater2 = this._GetSharedShip(data, ships_f.get_Item(i - 1));
                 if (shipModel_Eater2 != null)
                 {
                     this._shared.Add(shipModel_Eater2);
                 }
             }
             if (i < ships_f.get_Count() - 1)
             {
                 ShipModel_Eater shipModel_Eater3 = this._GetSharedShip(data, ships_f.get_Item(i + 1));
                 if (shipModel_Eater3 != null)
                 {
                     this._shared.Add(shipModel_Eater3);
                 }
             }
             this._ships.Add(shipModel_Eater);
         }
     }
     Enumerable.Distinct <ShipModel_Eater>(this._ships);
 }
Ejemplo n.º 2
0
 public RationModel(List <ShipModel_BattleAll> ships_f, Dictionary <int, List <Mst_slotitem> > data)
 {
     _ships  = new List <ShipModel_Eater>();
     _shared = new List <ShipModel_Eater>();
     for (int i = 0; i < ships_f.Count; i++)
     {
         ShipModel_BattleAll shipModel_BattleAll = ships_f[i];
         if (shipModel_BattleAll == null || !data.ContainsKey(shipModel_BattleAll.TmpId))
         {
             continue;
         }
         ShipModel_Eater item = shipModel_BattleAll.__CreateEater__();
         if (i > 0)
         {
             ShipModel_Eater shipModel_Eater = _GetSharedShip(data, ships_f[i - 1]);
             if (shipModel_Eater != null)
             {
                 _shared.Add(shipModel_Eater);
             }
         }
         if (i < ships_f.Count - 1)
         {
             ShipModel_Eater shipModel_Eater2 = _GetSharedShip(data, ships_f[i + 1]);
             if (shipModel_Eater2 != null)
             {
                 _shared.Add(shipModel_Eater2);
             }
         }
         _ships.Add(item);
     }
     _ships.Distinct();
 }
 private ShipModel_Eater _GetSharedShip(Dictionary <int, List <Mst_slotitem> > data, ShipModel_BattleAll candidate)
 {
     if (candidate == null)
     {
         return(null);
     }
     if (candidate.DmgStateEnd == DamageState_Battle.Gekichin)
     {
         return(null);
     }
     if (candidate.IsEscape())
     {
         return(null);
     }
     if (data.ContainsKey(candidate.TmpId))
     {
         return(null);
     }
     return(candidate.__CreateEater__());
 }