Example #1
0
    protected virtual void ActualSetItemInfo()
    {
        int renderCount = 0;

        for (int idx = 0; idx < _listItems.Count; ++idx)
        {
            Transform item = m_Content.GetChild(idx);

            SlotItemInfo infoComp = item.gameObject.GetComponent <SlotItemInfo>();

            if (infoComp == null)
            {
                continue;
            }
            infoComp.info = _listItems[idx];
            if (item.gameObject.activeSelf == false)
            {
                item.gameObject.SetActive(true);
            }
            renderCount++;
        }

        if (renderCount < m_Content.childCount)
        {
            for (int idx = renderCount; idx < m_Content.childCount; ++idx)
            {
                m_Content.GetChild(idx).gameObject.SetActive(false);
            }
        }
    }
 public SlotInfo(SlotItemInfo Info, bool Available, int Carry, int Star)
 {
     this.Info      = Info;
     this.Available = Available;
     this.Carry     = Carry;
     this.Star      = Star;
 }
Example #3
0
        public ShipSlotData(SlotItemInfo item, int maximum = -1, int current = -1)
        {
            this.Source   = item;
            this.Maximum  = maximum;
            this._Current = current;

            if (item == null)
            {
                return;
            }

            var m = Plugin.RawStart2.api_mst_slotitem.SingleOrDefault(x => x.api_id == item.Id);

            if (m == null)
            {
                return;
            }
            this.Armer     = m.api_souk;
            this.Firepower = m.api_houg;
            this.Torpedo   = m.api_raig;
            this.Bomb      = m.api_baku;
            this.AA        = m.api_tyku;
            this.ASW       = m.api_tais;
            this.Hit       = m.api_houm;
            this.Evade     = m.api_houk;
            this.LOS       = m.api_saku;
            this.Type2     = (Type2)m.api_type[1];
        }
Example #4
0
        public ShipSlotData(SlotItemInfo item, int maximum = -1, int current = -1)
        {
            this.Source   = item;
            this.Maximum  = maximum;
            this._Current = current;

            if (item == null)
            {
                return;
            }

            var m = DataStorage.Instance.Master.SlotItems
                    .Select(x => x.Value)
                    .SingleOrDefault(x => x.Id == item.Id);

            if (m == null)
            {
                return;
            }

            this.Armor     = m.Armor;
            this.Firepower = m.Firepower;
            this.Torpedo   = m.Torpedo;
            this.Bomb      = m.Bomb;
            this.AA        = m.AA;
            this.ASW       = m.ASW;
            this.Hit       = m.Hit;
            this.Evade     = m.Evade;
            this.LOS       = m.ViewRange;
            this.Type2     = (Type2)m.RawData.api_type[1];
        }
 public EquipmentItemViewModel(SlotItemInfo EquipData)
 {
     this.Equipment = EquipData;
     this._Name     = this.Equipment?.Name ?? "???";
     this._Id       = this.Equipment?.Id.ToString() ?? "???";
     this._ItemType = this.Equipment?.TypeName ?? "???";
 }
Example #6
0
            public void Remodel(int level, int masterId)
            {
                this.RawData.api_level = level;
                this.Info = KanColleClient.Current.Master.SlotItems[masterId] ?? SlotItemInfo.Dummy;

                this.RaisePropertyChanged(nameof(this.Info));
                this.RaisePropertyChanged(nameof(this.Level));
            }
        /// <summary>
        /// 装備と搭載数を指定して、スロット単位の制空能力を計算します。
        /// </summary>
        public static int GetAirSuperiorityPotential(this SlotItemInfo slotItem, int onslot, AirSuperiorityCalculationOptions options = AirSuperiorityCalculationOptions.Default)
        {
            var calculator = slotItem.GetCalculator();

            return(options.HasFlag(calculator.Options) && onslot >= 1
                                ? calculator.GetAirSuperiority(slotItem, onslot, options)
                                : 0);
        }
Example #8
0
 public ShipSlotData(SlotItemInfo item, int maximum = -1, int current = -1, int level = 0, int proficiency = 0)
 {
     this.Source      = item;
     this.Maximum     = maximum;
     this.Current     = current;
     this.Level       = level;
     this.Proficiency = proficiency;
 }
        public SlotItemCounter(SlotItemInfo target, IEnumerable<SlotItem> items)
        {
            this.Target = target;

            this.itemsByLevel = items
                .GroupBy(x => x.Level)
                .ToDictionary(x => x.Key, x => new SlotItemCounterByLevel { Level = x.Key, Count = x.Count(), });
        }
Example #10
0
    protected virtual void ActualSetItemInfo()
    {
        m_rendercount = 0;

        int line_count = m_pages.Count;
        

        int real_idx = 0;
        currentStartLine = 0;
        currentEndLine = 0;
        if (line_count > minColumnOrRaw)
        {
            currentStartLine = line_count - minColumnOrRaw;
            currentEndLine = line_count - 1;
        }
        else
        {
            currentStartLine = 0;

            currentEndLine = line_count - 1;
        }
    
        for (int idx = currentStartLine; idx <= currentEndLine; ++idx)
        {
            int t = idx - currentStartLine;
            int loop = layout.constraintCount;
            if (loop > m_pages[idx].Count)
            {
                loop = m_pages[idx].Count;
            }
            for(int i=0;i < loop; ++i)
            {
                real_idx = t * layout.constraintCount + i;
                Transform item = m_Content.GetChild(real_idx);

                SlotItemInfo infoComp = item.gameObject.GetComponent<SlotItemInfo>();

                if (infoComp == null)
                    continue;
                infoComp.info = m_pages[idx][i];
                if (item.gameObject.activeSelf == false)
                {
                    item.gameObject.SetActive(true);
                }
                m_rendercount++;
            }

        }

        if (m_rendercount < m_Content.childCount)
        {
            for (int idx = m_rendercount; idx < m_Content.childCount; ++idx)
            {
                m_Content.GetChild(idx).gameObject.SetActive(false);
            }
        }  
    }
            public int GetAirSuperiority(SlotItemInfo slotItem, int onslot, AirSuperiorityCalculationOptions options)
            {
                // 装備の対空値とスロットの搭載数による制空値
                var airSuperiority = this.GetAirSuperiorityInternal(slotItem, onslot, options);

                // 装備の熟練度による制空値ボーナス
                airSuperiority += this.GetProficiencyBonus(slotItem, options);

                return((int)airSuperiority);
            }
Example #12
0
        public SlotItemCounter(SlotItemInfo target, IEnumerable <SlotItem> items)
        {
            this.Target = target;

            this.itemsByLevel = items
                                .GroupBy(x => x.Level)
                                .ToDictionary(x => x.Key, x => new SlotItemCounterByLevel {
                Level = x.Key, Count = x.Count(),
            });
        }
Example #13
0
        void _updateSlotItemList(IEnumerable <MemberData.Item.Info> items)
        {
            ///内部情報の再構成
            _slotItemData.Clear();
            foreach (var it in items)
            {
                SlotItemInfo info;
                if (_slotItemData.ContainsKey(it.SlotItemType))
                {
                    info = _slotItemData[it.SlotItemType];
                    info.AddSlotItemOwner(it.Owner);
                    info.Count++;
                }
                else
                {
                    info = new SlotItemInfo(it);
                    _slotItemData[it.SlotItemType] = info;
                    info.Count = 1;
                }
            }

            ///ビューの更新
            lvSlotItemList.BeginUpdate();

            Dictionary <int, SlotItemLVItem> updateMap = new Dictionary <int, SlotItemLVItem>();

            foreach (SlotItemLVItem it in lvSlotItemList.Items)
            {
                updateMap[it.Info.ID] = it;
            }

            foreach (var it in _slotItemData)
            {
                if (updateMap.ContainsKey(it.Key))
                {
                    updateMap[it.Key].Update(it.Value);
                    updateMap.Remove(it.Key);
                }
                else
                {
                    lvSlotItemList.Items.Add(new SlotItemLVItem(it.Value));
                }
            }

            foreach (var it in updateMap.Values)
            {
                lvSlotItemList.Items.Remove(it);
            }

            updateFormTitle();

            lvSlotItemList.EndUpdate();
        }
Example #14
0
		public SlotItemCounter(SlotItemInfo target, IEnumerable<SlotItem> items)
		{
			this.Target = target;
			this.itemsByLevel = items
				.GroupBy(x => x.Adept > 0 ? 10 + x.Adept : x.Level)
				.ToDictionary(x => x.Key > 10 ? x.Key - 10 : x.Key, x => new SlotItemCounterByLevel
				{
					Level = x.Key > 10 ? x.Key - 10 : x.Key,
					Count = x.Count(),
					IsPlane = x.Key > 10,
					LevelText = x.Key > 10 ? x.First().AdeptText : x.First().LevelText
				});
		}
 public SlotItemCounter(SlotItemInfo target, IEnumerable <SlotItem> items)
 {
     this.Target       = target;
     this.itemsByLevel = items
                         .GroupBy(x => x.Adept > 0 ? 10 + x.Adept : x.Level)
                         .ToDictionary(x => x.Key > 10 ? x.Key - 10 : x.Key, x => new SlotItemCounterByLevel
     {
         Level     = x.Key > 10 ? x.Key - 10 : x.Key,
         Count     = x.Count(),
         IsPlane   = x.Key > 10,
         LevelText = x.Key > 10 ? x.First().AdeptText : x.First().LevelText
     });
 }
Example #16
0
 public void OnClose()
 {
     if (_disabledTrans.Count > 0)
     {
         for (int idx = 0; idx < _disabledTrans.Count; ++idx)
         {
             SlotItemInfo info = _disabledTrans[idx].GetComponent <SlotItemInfo>();
             if (info != null)
             {
                 info.onValueChanged.RemoveAllListeners();
             }
         }
     }
 }
Example #17
0
            public SlotItemLVItem(SlotItemInfo info)
            {
                SubItems.Add("");
                SubItems.Add("");
                SubItems.Add("");
                SubItems.Add("");
                SubItems.Add("");

                SubItems[(int)ColumnIndex.ID].Text  = info.ID.ToString();
                SubItems[(int)ColumnIndex.種別].Text  = info.Type;
                SubItems[(int)ColumnIndex.装備名].Text = info.Name;

                Update(info);
            }
Example #18
0
 public EquiptInfo(SlotItemInfo info, int count, int id = 0)
 {
     if (info != null)
     {
         Level      = 0;
         AsControl  = info.IsAirSuperiorityFighter ? info.AA : 0;
         EquiptId   = info.Id;
         EquiptName = info.Name;
     }
     else
     {
         AsControl  = Level = 0;
         EquiptId   = id;
         EquiptName = id.ToString();
     }
     Id          = id;
     EquiptCount = count;
 }
        private static AirSuperiorityCalculator GetCalculator(this SlotItemInfo slotItem)
        {
            switch (slotItem.Type)
            {
            case SlotItemType.艦上戦闘機:
            case SlotItemType.水上戦闘機:
                return(new FighterCalculator());

            case SlotItemType.艦上攻撃機:
            case SlotItemType.艦上爆撃機:
                return(new AttackerCalculator());

            case SlotItemType.水上爆撃機:
                return(new SeaplaneBomberCalculator());

            default:
                return(EmptyCalculator.Instance);
            }
        }
        public ShipSlotData(SlotItemInfo item, int maximum = -1, int current = -1)
        {
            this.Source = item;
            this.Maximum = maximum;
            this._Current = current;

            if (item == null || item == SlotItemInfo.Dummy) return;

            this.Armer = item.Armer;
            this.Firepower = item.Firepower;
            this.Torpedo = item.Torpedo;
            this.Bomb = item.Bomb;
            this.AA = item.AA;
            this.ASW = item.ASW;
            this.Hit = item.Hit;
            this.Evade = item.Evade;
            this.LOS = item.RawData.api_saku;
            this.Type2 = (Type2)item.RawData.api_type[1];
        }
        private static Proficiency GetProficiency(this SlotItemInfo slotItem, AirSuperiorityCalculationOptions options)
        {
            int lv;

            if (options.HasFlag(AirSuperiorityCalculationOptions.ProficiencyMin))
            {
                lv = 0;
            }
            else if (options.HasFlag(AirSuperiorityCalculationOptions.ProficiencyMax))
            {
                lv = 7;
            }
            else
            {
                lv = 4;
            }

            return(proficiencies[Math.Max(Math.Min(lv, 7), 0)]);
        }
            protected override double GetAirSuperiorityInternal(SlotItemInfo slotItem, int onslot, AirSuperiorityCalculationOptions options)
            {
                int level;

                if (options.HasFlag(AirSuperiorityCalculationOptions.LevelMax))
                {
                    level = 10;
                }
                else if (options.HasFlag(AirSuperiorityCalculationOptions.LevelMin))
                {
                    level = 0;
                }
                else
                {
                    level = 5;
                }
                // 装備改修による対空値加算 (★ x 0.2)
                return((slotItem.AA + level * 0.2) * Math.Sqrt(onslot));
            }
        public ShipSlotData(SlotItemInfo item, int maximum = -1, int current = -1)
        {
            this.Source = item;
            this.Maximum = maximum;
            this._Current = current;

            if (item == null) return;

            var m = Plugin.RawStart2.api_mst_slotitem.SingleOrDefault(x => x.api_id == item.Id);
            if (m == null) return;
            this.Armer = m.api_souk;
            this.Firepower = m.api_houg;
            this.Torpedo = m.api_raig;
            this.Bomb = m.api_baku;
            this.AA = m.api_tyku;
            this.ASW = m.api_tais;
            this.Hit = m.api_houm;
            this.Evade = m.api_houk;
            this.LOS = m.api_saku;
            this.Type2 = (Type2)m.api_type[1];
        }
Example #24
0
        public ShipSlotData(SlotItemInfo item, int maximum = -1, int current = -1)
        {
            this.Source   = item;
            this.Maximum  = maximum;
            this._Current = current;

            if (item == null || item == SlotItemInfo.Dummy)
            {
                return;
            }

            this.Armer     = item.Armer;
            this.Firepower = item.Firepower;
            this.Torpedo   = item.Torpedo;
            this.Bomb      = item.Bomb;
            this.AA        = item.AA;
            this.ASW       = item.ASW;
            this.Hit       = item.Hit;
            this.Evade     = item.Evade;
            this.LOS       = item.RawData.api_saku;
            this.Type2     = (Type2)item.RawData.api_type[1];
        }
Example #25
0
            public void Update(SlotItemInfo info)
            {
                SubItems[(int)ColumnIndex.保有数].Text = info.Count.ToString();
                SubItems[(int)ColumnIndex.装着数].Text = info.UsingCount.ToString();

                StringBuilder sb = new StringBuilder();

                foreach (var it in info.ItemOwner)
                {
                    if (it.Count > 1)
                    {
                        sb.AppendFormat("{0}(Lv{1})x{2} ", it.Name, it.Level, it.Count);
                    }
                    else
                    {
                        sb.AppendFormat("{0}(Lv{1}) ", it.Name, it.Level);
                    }
                }
                SubItems[(int)ColumnIndex.装備艦娘].Text = sb.ToString();

                ImageIndex = info.TypeNum;
                Info       = info;
            }
Example #26
0
            int _compare(SlotItemInfo info2)
            {
                switch ((ColumnIndex)_column)
                {
                case ColumnIndex.ID:
                    return(Info.ID - info2.ID);

                case ColumnIndex.種別:
                    return(Info.TypeNum - info2.TypeNum);

                case ColumnIndex.装備名:
                    return(string.Compare(Info.Name, info2.Name));

                case ColumnIndex.保有数:
                    return(Info.Count - info2.Count);

                case ColumnIndex.装着数:
                    return(Info.UsingCount - info2.UsingCount);

                case ColumnIndex.装備艦娘:
                default:
                    return(0);
                }
            }
		public SlotItemViewModel(SlotItemInfo item)
		{
			this.SlotItem = item;
		}
 public SlotItemViewModel(SlotItemInfo item)
 {
     this.Ships    = new List <Counter>();
     this.SlotItem = item;
 }
Example #29
0
 public void SetAfterSlotItemInfo(SlotitemModel model)
 {
     mAfterSlotItemInfo = new SlotItemInfo(model);
 }
Example #30
0
 internal ItemInfo(SlotItemInfo info)
 {
     this.Info = info;
 }
		public SlotItemViewModel(SlotItemInfo item)
		{
			this.Ships = new List<Counter>();
			this.SlotItem = item;
		}
Example #32
0
 internal ItemInfo(SlotItemInfo info)
 {
     this.Info = info;
 }
 public SlotItemViewModel(ShipSlot item)
 {
     this.Slot = item;
     this.Info = Slot.Item.Info;
 }
 public SlotItemViewModel(SlotItem item)
 {
     this.SlotItem = item;
     this.Info     = SlotItem.Info;
 }
 public PlaneViewModel(SlotItemInfo info, int count)
 {
     this.slotItemInfo = info;
     this.Count        = count;
 }
 public SlotItemViewModel(SlotItemInfo item)
 {
     this.SlotItem = item;
 }
Example #37
0
 public void SetBeforeSlotItemInfo(SlotitemModel model)
 {
     mBeforeSlotItemInfo = new SlotItemInfo(model);
 }
Example #38
0
 public PlaneViewModel(SlotItemInfo info, int count)
 {
     this.slotItemInfo = info;
     this.Count = count;
 }