Exemplo n.º 1
0
        private void UpdateFleetsCombinedEnemy(int api_deck_id, ICommonEachBattleMembers data, int[] api_formation = null)
        {
            // 아군 정보 모항 기준으로 갱신
            this.UpdateFriendFleets(api_deck_id);

            this.EnemyFirst = new FleetData(
                data.ToMastersShipDataArray(),
                this.EnemyFirst?.Formation ?? Formation.없음,
                this.EnemyFirst?.Name ?? "",
                FleetType.EnemyFirst
                );

            this.EnemySecond = new FleetData(
                data.ToMastersSecondShipDataArray(),
                this.EnemySecond?.Formation ?? Formation.없음,
                this.EnemySecond?.Name ?? "",
                FleetType.EnemySecond
                );

            // 진형과 전투형태 존재하면
            if (api_formation != null)
            {
                if (this.AliasFirst != null)
                {
                    this.AliasFirst.Formation = (Formation)api_formation[0];
                }

                if (this.EnemyFirst != null)
                {
                    this.EnemyFirst.Formation = (Formation)api_formation[1];
                }
            }
        }
Exemplo n.º 2
0
        public static MastersShipData[] ToMastersSecondShipDataArray(this ICommonEachBattleMembers data)
        {
            var master = KanColleClient.Current.Master;

            return(data.api_ship_ke_combined
                   .Where(x => x != -1)
                   .Select((x, i) => new MastersShipData(master.Ships[x])
            {
                Slots = data.api_eSlot_combined[i]
                        .Where(s => 0 < s)
                        .Select(s => master.SlotItems[s])
                        .Select(s => new ShipSlotData(s))
                        .ToArray(),
            })
                   .ToArray());
        }
Exemplo n.º 3
0
        public static MastersShipData[] ToMastersSecondShipDataArray(this ICommonEachBattleMembers data)
        {
            var master = KanColleClient.Current.Master;

            return(data.api_ship_ke_combined
                   .Where(x => x != -1)
                   .Select((x, i) => new MastersShipData(master.Ships[x])
            {
                Level = data.api_ship_lv_combined[i + 1],
                Firepower = data.api_eParam_combined[i][0],
                Torpedo = data.api_eParam_combined[i][1],
                AA = data.api_eParam_combined[i][2],
                Armer = data.api_eParam_combined[i][3],
                Slots = data.api_eSlot_combined[i]
                        .Where(s => 0 < s)
                        .Select(s => master.SlotItems[s])
                        .Select(s => new ShipSlotData(s))
                        .ToArray(),
            })
                   .ToArray());
        }
Exemplo n.º 4
0
        public static MastersShipData[] ToMastersShipDataArray(this ICommonEachBattleMembers data)
        {
            var master = DataStorage.Instance.Master;

            return(data.api_ship_ke
                   .Where(x => x != -1)
                   .Select((x, i) => new MastersShipData(master.Ships[x])
            {
                Level = data.api_ship_lv[i + 1],
                Firepower = data.api_eParam[i][0],
                Torpedo = data.api_eParam[i][1],
                AA = data.api_eParam[i][2],
                Armor = data.api_eParam[i][3],
                Slots = data.api_eSlot[i]
                        .Where(s => 0 < s)
                        .Select(s => master.SlotItems[s])
                        .Select(s => new ShipSlotData(s))
                        .ToArray(),
            })
                   .ToArray());
        }