Пример #1
0
 private void ChangeSortKey(SortKey sortKey)
 {
     CurrentSortKey = sortKey;
     InitializeSortIcon(sortKey);
     ShipModel[] sortedModels = DeckUtil.GetSortedList(new List <ShipModel>(mShipModels), sortKey).ToArray();
     OnSortedShips(sortedModels);
 }
Пример #2
0
        public void DBG_damage()
        {
            if (this._debug_shipping)
            {
                return;
            }
            this._debug_shipping = true;
            UserInfoModel    userInfo  = this.rep.now_clsRepair().UserInfo;
            List <ShipModel> all_ships = userInfo.__GetShipList__();
            List <ShipModel> list      = this.rep.now_clsRepair().GetAreaShips(this.rep.NowArea(), all_ships);

            if (this.rep.NowArea() == 1)
            {
                list.AddRange(this.rep.now_clsRepair().GetDepotShips(all_ships));
            }
            list = DeckUtil.GetSortedList(list, SortKey.DAMAGE);
            using (List <ShipModel> .Enumerator enumerator = list.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    ShipModel current = enumerator.get_Current();
                    int       subvalue;
                    switch (this.damage_flag)
                    {
                    case 0:
                        subvalue = (int)Math.Ceiling((double)((float)current.MaxHp * 0.25f));
                        break;

                    case 1:
                        subvalue = (int)Math.Ceiling((double)((float)current.MaxHp * 0.25f));
                        break;

                    case 2:
                        subvalue = current.NowHp - 1;
                        break;

                    case 3:
                        goto IL_F9;

                    default:
                        goto IL_F9;
                    }
IL_115:
                    Debug_Mod.SubHp(current.MemId, subvalue);
                    continue;
IL_F9:
                    subvalue         = current.NowHp - current.MaxHp;
                    this.damage_flag = -1;
                    goto IL_115;
                }
            }
            this.damage_flag++;
            Mem.DelList <ShipModel>(ref all_ships);
            Mem.DelList <ShipModel>(ref list);
            CommonPopupDialog.Instance.StartPopup("DBG: 母港へ行きます。");
            SingletonMonoBehaviour <PortObjectManager> .Instance.BackToActiveScene();

            this._debug_shipping = false;
        }
Пример #3
0
        private void _UpdateShipList()
        {
            List <ShipModel> all_ships = base.UserInfo.__GetShipList__();

            _breakable_ships = GetAreaShips(1, use_deck: false, use_edeck: false, all_ships);
            _breakable_ships.AddRange(GetDepotShips(all_ships));
            _breakable_ships = DeckUtil.GetSortedList(_breakable_ships, _pre_sort_key);
        }
Пример #4
0
 public bool ChangeSortKey(SortKey new_sort_key)
 {
     if (_pre_sort_key != new_sort_key)
     {
         _pre_sort_key = new_sort_key;
         _ships        = DeckUtil.GetSortedList(_ships, _pre_sort_key);
         return(true);
     }
     return(false);
 }
Пример #5
0
		protected void _UpdateOtherShips()
		{
			List<ShipModel> all_ships = base.UserInfo.__GetShipList__();
			_other_ships = GetAreaShips(AreaId, use_deck: false, use_edeck: true, all_ships);
			if (_area_id == 1)
			{
				_other_ships.AddRange(GetDepotShips(all_ships));
			}
			_other_ships = DeckUtil.GetSortedList(_other_ships, SortKey.LEVEL);
		}
Пример #6
0
        public List <ShipModel> CreateShipList(int count)
        {
            List <ShipModel> list = base.UserInfo.__GetShipList__();

            if (_cache_takeover_ships == null || _cache_takeover_ships.Count > 0)
            {
            }
            count = Math.Min(count, list.Count);
            return(DeckUtil.GetSortedList(list, SortKey.LEVEL).GetRange(0, count));
        }
Пример #7
0
        protected void _UpdateOtherShips()
        {
            List <ShipModel> all_ships = base.UserInfo.__GetShipList__();

            this._other_ships = base.GetAreaShips(this.AreaId, false, true, all_ships);
            if (this._area_id == 1)
            {
                this._other_ships.AddRange(base.GetDepotShips(all_ships));
            }
            this._other_ships = DeckUtil.GetSortedList(this._other_ships, SortKey.LEVEL);
        }
Пример #8
0
        private void _Initialize()
        {
            List <ShipModel> all_ships = base.UserInfo.__GetShipList__();

            _other_ships = GetAreaShips(_area_id, use_deck: false, use_edeck: true, all_ships);
            if (_area_id == 1)
            {
                _other_ships.AddRange(GetDepotShips(all_ships));
            }
            _other_ships = _other_ships.FindAll((ShipModel ship) => ship.GetResourcesForSupply().HasPositive());
            _other_ships = DeckUtil.GetSortedList(_other_ships, _pre_sort_key);
        }
Пример #9
0
        private void _UpdateRepairShipList()
        {
            List <ShipModel> all_ships = base.UserInfo.__GetShipList__();

            _ships = GetAreaShips(MapArea.Id, all_ships);
            if (_area_id == 1)
            {
                _ships.AddRange(GetDepotShips(all_ships));
            }
            _ships = _ships.FindAll((ShipModel ship) => ship.NowHp < ship.MaxHp);
            _ships = DeckUtil.GetSortedList(_ships, _pre_sort_key);
        }
Пример #10
0
        private void _Initialize()
        {
            List <ShipModel> all_ships = base.UserInfo.__GetShipList__();

            this._other_ships = base.GetAreaShips(this._area_id, false, true, all_ships);
            if (this._area_id == 1)
            {
                this._other_ships.AddRange(base.GetDepotShips(all_ships));
            }
            this._other_ships = this._other_ships.FindAll((ShipModel ship) => ship.GetResourcesForSupply().HasPositive());
            this._other_ships = DeckUtil.GetSortedList(this._other_ships, this._pre_sort_key);
        }
Пример #11
0
 public bool ChangeSortKey(SortKey new_sort_key)
 {
     if (_pre_sort_key != new_sort_key)
     {
         _pre_sort_key = new_sort_key;
         _other_ships  = DeckUtil.GetSortedList(_other_ships, _pre_sort_key);
         if (_selected_deck == null)
         {
             InitForOther();
         }
         return(true);
     }
     return(false);
 }
Пример #12
0
        private void _UpdateShipList()
        {
            List <ShipModel> list = base.UserInfo.__GetShipList__();

            if (MapArea.Id == 1)
            {
                _ships = list;
            }
            else
            {
                _ships = GetAreaShips(MapArea.Id, list);
                _ships.AddRange(GetDepotShips(list));
            }
            _ships = DeckUtil.GetSortedList(_ships, _pre_sort_key);
        }
Пример #13
0
        private void _UpdateShipList()
        {
            List <ShipModel> list = base.UserInfo.__GetShipList__();

            if (this.MapArea.Id == 1)
            {
                this._ships = list;
            }
            else
            {
                this._ships = base.GetAreaShips(this.MapArea.Id, list);
                this._ships.AddRange(base.GetDepotShips(list));
            }
            this._ships = DeckUtil.GetSortedList(this._ships, this._pre_sort_key);
        }
Пример #14
0
        public void DBG_damage()
        {
            if (!_debug_shipping)
            {
                _debug_shipping = true;
                UserInfoModel    userInfo  = rep.now_clsRepair().UserInfo;
                List <ShipModel> p         = userInfo.__GetShipList__();
                List <ShipModel> areaShips = rep.now_clsRepair().GetAreaShips(rep.NowArea(), p);
                if (rep.NowArea() == 1)
                {
                    areaShips.AddRange(rep.now_clsRepair().GetDepotShips(p));
                }
                areaShips = DeckUtil.GetSortedList(areaShips, SortKey.DAMAGE);
                foreach (ShipModel item in areaShips)
                {
                    int subvalue;
                    switch (damage_flag)
                    {
                    case 0:
                        subvalue = (int)Math.Ceiling((float)item.MaxHp * 0.25f);
                        break;

                    case 1:
                        subvalue = (int)Math.Ceiling((float)item.MaxHp * 0.25f);
                        break;

                    case 2:
                        subvalue = item.NowHp - 1;
                        break;

                    default:
                        subvalue    = item.NowHp - item.MaxHp;
                        damage_flag = -1;
                        break;
                    }
                    Debug_Mod.SubHp(item.MemId, subvalue);
                }
                damage_flag++;
                Mem.DelList(ref p);
                Mem.DelList(ref areaShips);
                CommonPopupDialog.Instance.StartPopup("DBG: 母港へ行きます。");
                SingletonMonoBehaviour <PortObjectManager> .Instance.BackToActiveScene();

                _debug_shipping = false;
            }
        }
Пример #15
0
        private void _UpdateShipList()
        {
            List <ShipModel> list = base.UserInfo.__GetShipList__();

            if (MapArea.Id == 1)
            {
                _ships = list;
            }
            else
            {
                _ships = GetAreaShips(MapArea.Id, list);
                _ships.AddRange(GetDepotShips(list));
            }
            Dictionary <int, int> tmp = _api.Mst_escort_group;

            if (tmp != null)
            {
                _ships = _ships.FindAll((ShipModel ship) => tmp[ship.ShipType] == 1);
            }
            _ships = DeckUtil.GetSortedList(_ships, _pre_sort_key);
        }
Пример #16
0
        private void _UpdateShipList()
        {
            List <ShipModel> list = base.UserInfo.__GetShipList__();

            if (this.MapArea.Id == 1)
            {
                this._ships = list;
            }
            else
            {
                this._ships = base.GetAreaShips(this.MapArea.Id, list);
                this._ships.AddRange(base.GetDepotShips(list));
            }
            Dictionary <int, int> tmp = this._api.Mst_escort_group;

            if (tmp != null)
            {
                this._ships = this._ships.FindAll((ShipModel ship) => tmp.get_Item(ship.ShipType) == 1);
            }
            this._ships = DeckUtil.GetSortedList(this._ships, this._pre_sort_key);
        }
Пример #17
0
 internal ShipModel[] SortModels(SortKey sortKey)
 {
     return(DeckUtil.GetSortedList(new List <ShipModel>(mShipModels), sortKey).ToArray());
 }