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; this.CompleteTime = this.State == RepairingDockState.Repairing ? (DateTimeOffset?)Definitions.UnixEpoch.AddMilliseconds(rawData.api_complete_time) : null; }
internal void Update(kcsapi_ndock rawData) { System.Diagnostics.Debug.Assert(this.Id == rawData.api_id); var oldState = this.State; this.State = (RepairingDockState)rawData.api_state; if (oldState == RepairingDockState.Repairing && this.State == RepairingDockState.Unlocked) { Finish(); } this.ShipId = rawData.api_ship_id; this.Ship = this.State == RepairingDockState.Repairing ? this.homeport.Organization.Ships[this.ShipId] : null; this.CompleteTime = this.State == RepairingDockState.Repairing ? (DateTimeOffset?)Definitions.UnixEpoch.AddMilliseconds(rawData.api_complete_time) : null; }
internal RepairingDock(Homeport parent, kcsapi_ndock rawData) { this.homeport = parent; this.Update(rawData); }
internal RepairingDock(Homeport parent, kcsapi_ndock rawData) : base(false) { this.homeport = parent; this._Id = rawData.api_id; this.Update(rawData); }