Ejemplo n.º 1
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;
     this.CompleteTime = this.State == RepairingDockState.Repairing
                         ? (DateTimeOffset?)Definitions.UnixEpoch.AddMilliseconds(rawData.api_complete_time)
                         : null;
 }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 internal RepairingDock(Homeport parent, kcsapi_ndock rawData)
 {
     this.homeport = parent;
     this.Update(rawData);
 }
Ejemplo n.º 4
0
 internal RepairingDock(Homeport parent, kcsapi_ndock rawData) : base(false)
 {
     this.homeport = parent;
     this._Id      = rawData.api_id;
     this.Update(rawData);
 }