Ejemplo n.º 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)));
     }
 }
Ejemplo n.º 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)));
     }
 }
Ejemplo n.º 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)));
     }
 }
Ejemplo n.º 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());
        }
Ejemplo n.º 5
0
 internal RepairingDock(Homeport parent, kcsapi_ndock rawData)
 {
     this.homeport = parent;
     this.Update(rawData);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 7
0
 internal RepairingDock(kcsapi_ndock rawData)
 {
     this.Update(rawData);
 }
Ejemplo n.º 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;
		}
Ejemplo n.º 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));
 }