예제 #1
0
 internal void Update(kcsapi_ndock[] source)
 {
     if (this.Docks.Count == source.Length)
     {
         foreach (var raw in source) this.Docks[raw.api_id]?.Update(raw);
     }
     else
     {
         foreach (var dock in this.Docks) dock.Value?.Dispose();
         this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(this.homeport, x)));
     }
 }
예제 #2
0
 private void Update(kcsapi_ndock[] source)
 {
     if (this.Docks.Count == source.Length)
     {
         foreach (var raw in source)
         {
             var target = this.Docks[raw.api_id];
             if (target != null) target.Update(raw);
         }
     }
     else
     {
         this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(x)));
     }
 }
예제 #3
0
 internal void Update(kcsapi_ndock[] source)
 {
     if (this.Docks.Count == source.Length)
     {
         foreach (var raw in source)
         {
             var target = this.Docks[raw.api_id];
             if (target != null) target.Update(raw);
         }
     }
     else
     {
         this.Docks.ForEach(x => x.Value.Dispose());
         this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(homeport, x)));
     }
 }
예제 #4
0
        private void Update(kcsapi_ndock[] source)
        {
            if (this.Docks.Count == source.Length)
            {
                foreach (var raw in source)
                {
                    var target = this.Docks[raw.api_id];
                    if (target != null) target.Update(raw);
                }
            }
            else
            {
                this.Docks.ForEach(x => x.Value.Dispose());
                this.Docks = new MemberTable<RepairingDock>(source.Select(x => new RepairingDock(homeport, x)));
            }

            // 艦娘を入渠させたとき、ship2 -> ndock の順でデータが来るため、
            // ndock の後で改めて各艦隊のステータスを更新してやらないと入渠ステータスに変更できない
            this.homeport.Fleets.ForEach(x => x.Value.UpdateStatus());
        }
예제 #5
0
 internal RepairingDock(Homeport parent, kcsapi_ndock rawData)
 {
     this.homeport = parent;
     this.Update(rawData);
 }
예제 #6
0
 internal void Update(kcsapi_ndock rawData)
 {
     this.Id = rawData.api_id;
     this.State = (RepairingDockState)rawData.api_state;
     this.ShipId = rawData.api_ship_id;
     this.Ship = this.State == RepairingDockState.Repairing ? this.homeport.Ships[this.ShipId] : null;
     this.CompleteTime = this.State == RepairingDockState.Repairing
         ? (DateTimeOffset?)Definitions.UnixEpoch.AddMilliseconds(rawData.api_complete_time)
         : null;
 }
예제 #7
0
 internal RepairingDock(kcsapi_ndock rawData)
 {
     this.Update(rawData);
 }
예제 #8
0
		internal void Update(kcsapi_ndock rawData)
		{
			this.Id = rawData.api_id;
			this.State = (RepairingDockState)rawData.api_state;
			this.ShipId = rawData.api_ship_id;
			this.Ship = this.State == RepairingDockState.Repairing ? this.homeport.Organization.Ships[this.ShipId] : null;
            if (this.State == RepairingDockState.Repairing)
            {
                var fleet = this.homeport.Organization.GetFleet(this.ShipId);
                if (fleet != null) fleet.State.Update();
            }
			this.CompleteTime = this.State == RepairingDockState.Repairing
				? (DateTimeOffset?)Definitions.UnixEpoch.AddMilliseconds(rawData.api_complete_time)
				: null;
		}
예제 #9
0
 internal void Update(kcsapi_ndock[] source)
 {
     if(this.Docks.SetValueRange(source, x => x.api_id, x => new RepairingDock(homeport, x), (obj, dat) => obj.Update(dat), true, x => x.Dispose()))
         RaisePropertyChanged(nameof(Docks));
 }