예제 #1
0
        public List <int> __GetShipMemIdInDecks__()
        {
            List <int> list = new List <int>();

            using (Dictionary <int, DeckModel> .ValueCollection.Enumerator enumerator = this._decks.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    DeckModel current = enumerator.get_Current();
                    list.AddRange(current.__GetShipMemIds__());
                }
            }
            return(list);
        }
예제 #2
0
 public DeckModel GetDeckByShipMemId(int ship_mem_id)
 {
     using (Dictionary <int, DeckModel> .ValueCollection.Enumerator enumerator = this._decks.get_Values().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             DeckModel current = enumerator.get_Current();
             if (current.HasShipMemId(ship_mem_id))
             {
                 return(current);
             }
         }
     }
     return(null);
 }
        public override string ToString()
        {
            string text = string.Format("[海域{0}:{1}]", this.Id, this.Name);
            Mem_rebellion_point mem_rebellion_point;

            Comm_UserDatas.Instance.User_rebellion_point.TryGetValue(this.Id, ref mem_rebellion_point);
            text += string.Format(" RP:{0}({1})", this.RState, (mem_rebellion_point != null) ? mem_rebellion_point.Point : 0);
            if (!this.IsOpen())
            {
                text += string.Format(" [未開放] ", new object[0]);
            }
            AreaTankerModel tankerCount = this.GetTankerCount();

            text += string.Format(" 輸送船:{0}/{1}(移動中:{2},遠征中:{3}) ", new object[]
            {
                tankerCount.GetCountNoMove(),
                tankerCount.GetMaxCount(),
                tankerCount.GetCountMove(),
                tankerCount.GetCountInMission()
            });
            text += string.Format("入渠ドック: {0} ", this.ToString(this.GetNDockStateList()));
            DeckModel[] decks = this.GetDecks();
            if (decks.Length == 0)
            {
                text += string.Format("海域に艦隊無し", new object[0]);
            }
            else
            {
                for (int i = 0; i < decks.Length; i++)
                {
                    DeckModel deckModel = decks[i];
                    text += string.Format("{0}", deckModel);
                }
            }
            EscortDeckModel escortDeck = this.GetEscortDeck();

            if (escortDeck == null)
            {
                text += string.Format(" 護衛艦隊無し", new object[0]);
            }
            else
            {
                text += string.Format(" {0}", escortDeck);
            }
            return(text);
        }
예제 #4
0
        public void __UpdateDeck__(Api_get_Member api_get_mem)
        {
            Api_Result <Dictionary <int, Mem_deck> > api_Result = api_get_mem.Deck();

            if (api_Result.state == Api_Result_State.Success)
            {
                foreach (int key in api_Result.data.Keys)
                {
                    Mem_deck mem_deck = api_Result.data[key];
                    if (_decks.TryGetValue(key, out DeckModel value))
                    {
                        value.__Update__(mem_deck, _ships);
                    }
                    else
                    {
                        _decks[key] = new DeckModel(mem_deck, _ships);
                    }
                }
            }
        }
예제 #5
0
        public HashSet <int> __GetShipMemIdHashInBothDeck__()
        {
            HashSet <int> hashSet = new HashSet <int>();

            using (Dictionary <int, DeckModel> .ValueCollection.Enumerator enumerator = this._decks.get_Values().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    DeckModel   current = enumerator.get_Current();
                    ShipModel[] ships   = current.GetShips();
                    for (int i = 0; i < ships.Length; i++)
                    {
                        if (ships[i] != null)
                        {
                            hashSet.Add(ships[i].MemId);
                        }
                    }
                }
            }
            using (Dictionary <int, __EscortDeckModel__> .ValueCollection.Enumerator enumerator2 = this._escort_decks.get_Values().GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    EscortDeckModel current2 = enumerator2.get_Current();
                    ShipModel[]     ships    = current2.GetShips();
                    for (int j = 0; j < ships.Length; j++)
                    {
                        if (ships[j] != null)
                        {
                            hashSet.Add(ships[j].MemId);
                        }
                    }
                }
            }
            return(hashSet);
        }
예제 #6
0
 public UserPreActionPhaseResultModel(TurnWorkResult data, ManagerBase manager) : base(data)
 {
     this._bling_end_ships        = new List <ShipModel>();
     this._bling_end_escort_decks = new List <EscortDeckModel>();
     this._bling_end_tanker       = new Dictionary <int, int>();
     if (this._data.BlingEndShip != null)
     {
         Api_Result <Dictionary <int, Mem_ship> > api_Result = new Api_get_Member().Ship(this._data.BlingEndShip);
         if (api_Result.state == Api_Result_State.Success)
         {
             for (int i = 0; i < this._data.BlingEndShip.get_Count(); i++)
             {
                 int num = this._data.BlingEndShip.get_Item(i);
                 this._bling_end_ships.Add(new ShipModel(api_Result.data.get_Item(num)));
             }
         }
     }
     if (this._data.BlingEndEscortDeck != null)
     {
         for (int j = 0; j < this._data.BlingEndEscortDeck.get_Count(); j++)
         {
             int             num2       = this._data.BlingEndEscortDeck.get_Item(j);
             int             area_id    = num2;
             EscortDeckModel escortDeck = manager.UserInfo.GetEscortDeck(area_id);
             this._bling_end_escort_decks.Add(escortDeck);
         }
     }
     if (this._data.BlingEndTanker != null)
     {
         using (Dictionary <int, List <Mem_tanker> > .KeyCollection.Enumerator enumerator = this._data.BlingEndTanker.get_Keys().GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 int current = enumerator.get_Current();
                 this._bling_end_tanker.set_Item(current, this._data.BlingEndTanker.get_Item(current).get_Count());
             }
         }
     }
     this._mission_results = new List <MissionResultModel>();
     if (data.MissionEndDecks != null && data.MissionEndDecks.get_Count() > 0)
     {
         for (int k = 0; k < data.MissionEndDecks.get_Count(); k++)
         {
             int                   rid        = data.MissionEndDecks.get_Item(k).Rid;
             DeckModel             deck       = manager.UserInfo.GetDeck(rid);
             ShipModel[]           ships      = deck.GetShips();
             Dictionary <int, int> dictionary = new Dictionary <int, int>();
             for (int l = 0; l < ships.Length; l++)
             {
                 ShipModel shipModel = ships[l];
                 dictionary.set_Item(shipModel.MemId, shipModel.Exp_Percentage);
             }
             Api_Result <MissionResultFmt> api_Result2 = new Api_req_Mission().Result(rid);
             if (api_Result2.state == Api_Result_State.Success)
             {
                 MissionResultFmt data2 = api_Result2.data;
                 this._mission_results.Add(new MissionResultModel(data2, manager.UserInfo, dictionary));
             }
         }
     }
     this._resources = new MaterialInfo(this._data.TransportMaterial);
     this._resources_monthly_bonus = new MaterialInfo(this._data.BonusMaterialMonthly);
     this._resources_weekly_bonus  = new MaterialInfo(this._data.BonusMaterialWeekly);
     this._rewards = new List <IReward>();
     if (this._data.SpecialItem != null && this._data.SpecialItem.get_Count() > 0)
     {
         for (int m = 0; m < this._data.SpecialItem.get_Count(); m++)
         {
             ItemGetFmt itemGetFmt = this._data.SpecialItem.get_Item(m);
             if (itemGetFmt.Category == ItemGetKinds.Ship)
             {
                 this._rewards.Add(new Reward_Ship(itemGetFmt.Id));
             }
             else if (itemGetFmt.Category == ItemGetKinds.SlotItem)
             {
                 this._rewards.Add(new Reward_Slotitem(itemGetFmt.Id, itemGetFmt.Count));
             }
             else if (itemGetFmt.Category == ItemGetKinds.UseItem)
             {
                 this._rewards.Add(new Reward_Useitem(itemGetFmt.Id, itemGetFmt.Count));
             }
         }
     }
 }
예제 #7
0
 public MapSupplyModel(DeckModel deck, MapSupplyFmt fmt)
 {
     _ship        = deck.GetShipFromMemId(fmt.useShip);
     _given_ships = fmt.givenShip.ConvertAll((int mem_id) => deck.GetShipFromMemId(mem_id));
 }
예제 #8
0
        public ShipModel GetFlagShip(int deck_id)
        {
            DeckModel deck = GetDeck(deck_id);

            return(deck.GetFlagShip());
        }
예제 #9
0
        public int GetDeckID(int ship_mem_id)
        {
            DeckModel deckByShipMemId = this.GetDeckByShipMemId(ship_mem_id);

            return((deckByShipMemId != null) ? deckByShipMemId.Id : -1);
        }
예제 #10
0
 public UserPreActionPhaseResultModel(TurnWorkResult data, ManagerBase manager)
     : base(data)
 {
     _bling_end_ships        = new List <ShipModel>();
     _bling_end_escort_decks = new List <EscortDeckModel>();
     _bling_end_tanker       = new Dictionary <int, int>();
     if (_data.BlingEndShip != null)
     {
         Api_Result <Dictionary <int, Mem_ship> > api_Result = new Api_get_Member().Ship(_data.BlingEndShip);
         if (api_Result.state == Api_Result_State.Success)
         {
             for (int i = 0; i < _data.BlingEndShip.Count; i++)
             {
                 int key = _data.BlingEndShip[i];
                 _bling_end_ships.Add(new ShipModel(api_Result.data[key]));
             }
         }
     }
     if (_data.BlingEndEscortDeck != null)
     {
         for (int j = 0; j < _data.BlingEndEscortDeck.Count; j++)
         {
             int             num        = _data.BlingEndEscortDeck[j];
             int             area_id    = num;
             EscortDeckModel escortDeck = manager.UserInfo.GetEscortDeck(area_id);
             _bling_end_escort_decks.Add(escortDeck);
         }
     }
     if (_data.BlingEndTanker != null)
     {
         foreach (int key2 in _data.BlingEndTanker.Keys)
         {
             _bling_end_tanker[key2] = _data.BlingEndTanker[key2].Count;
         }
     }
     _mission_results = new List <MissionResultModel>();
     if (data.MissionEndDecks != null && data.MissionEndDecks.Count > 0)
     {
         for (int k = 0; k < data.MissionEndDecks.Count; k++)
         {
             int                   rid        = data.MissionEndDecks[k].Rid;
             DeckModel             deck       = manager.UserInfo.GetDeck(rid);
             ShipModel[]           ships      = deck.GetShips();
             Dictionary <int, int> dictionary = new Dictionary <int, int>();
             foreach (ShipModel shipModel in ships)
             {
                 dictionary[shipModel.MemId] = shipModel.Exp_Percentage;
             }
             Api_Result <MissionResultFmt> api_Result2 = new Api_req_Mission().Result(rid);
             if (api_Result2.state == Api_Result_State.Success)
             {
                 MissionResultFmt data2 = api_Result2.data;
                 _mission_results.Add(new MissionResultModel(data2, manager.UserInfo, dictionary));
             }
         }
     }
     _resources = new MaterialInfo(_data.TransportMaterial);
     _resources_monthly_bonus = new MaterialInfo(_data.BonusMaterialMonthly);
     _resources_weekly_bonus  = new MaterialInfo(_data.BonusMaterialWeekly);
     _rewards = new List <IReward>();
     if (_data.SpecialItem == null || _data.SpecialItem.Count <= 0)
     {
         return;
     }
     for (int m = 0; m < _data.SpecialItem.Count; m++)
     {
         ItemGetFmt itemGetFmt = _data.SpecialItem[m];
         if (itemGetFmt.Category == ItemGetKinds.Ship)
         {
             _rewards.Add(new Reward_Ship(itemGetFmt.Id));
         }
         else if (itemGetFmt.Category == ItemGetKinds.SlotItem)
         {
             _rewards.Add(new Reward_Slotitem(itemGetFmt.Id, itemGetFmt.Count));
         }
         else if (itemGetFmt.Category == ItemGetKinds.UseItem)
         {
             _rewards.Add(new Reward_Useitem(itemGetFmt.Id, itemGetFmt.Count));
         }
     }
 }