Esempio n. 1
0
        /// <summary>
        /// 指定した <see cref="kcsapi_ship2"/> 型の配列を使用して、<see cref="Ships"/> プロパティ値を更新します。
        /// </summary>
        internal void Update(kcsapi_ship2[] source)
        {
            if (source.Length <= 1)
            {
                foreach (var ship in source)
                {
                    var target = this.Ships[ship.api_id];
                    if (target == null) continue;

                    target.Update(ship);

                    var fleet = this.GetFleet(target.Id);
                    if (fleet != null) fleet.Calculate();
                }
            }
            else
            {
                this.Ships = new MemberTable<Ship>(source.Select(x => new Ship(this.homeport, x)));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 指定した <see cref="kcsapi_ship2"/> 型の配列を使用して、<see cref="Ships"/> プロパティ値を更新します。
        /// </summary>
        internal void Update(kcsapi_ship2[] source)
        {
            if (source.Length <= 1)
            {
                foreach (var ship in source)
                {
                    var target = this.Ships[ship.api_id];
                    if (target == null) continue;

                    target.Update(ship);

                    var fleet = this.GetFleet(target.Id);
                    if (fleet != null) fleet.State.Calculate();
                }
            }
            else
            {
                this.Ships = new MemberTable<Ship>(source.Select(x => new Ship(this.homeport, x)));

                if (KanColleClient.Current.IsInSortie)
                {
                    foreach (var id in this.evacuatedShipsIds) this.Ships[id].Situation |= ShipSituation.Evacuation;
                    foreach (var id in this.towShipIds) this.Ships[id].Situation |= ShipSituation.Tow;
                }
            }
        }
Esempio n. 3
0
 private void UpdateShips(kcsapi_ship2[] source)
 {
     if (source.Length <= 1)
     {
         foreach (var ship in source)
         {
             var target = this.Ships[ship.api_id];
             if (target != null) target.Update(ship);
         }
     }
     else
     {
         this.Ships = new MemberTable<Ship>(source.Select(s => new Ship(this, s)));
     }
 }