private IEnumerable <ApiEvent> ConvertEvent(ShipyardSwap e) { // Send event for old ship indicating it's location var @event = new ApiEvent("setCommanderShip") { Timestamp = e.Timestamp, EventData = new Dictionary <string, object>() { { "shipType", e.StoreOldShip }, { "shipGameID", e.StoreShipId }, { "marketID", e.MarketId }, { "starsystemName", playerStateRecorder.GetPlayerSystem(e.Timestamp) }, { "stationName", playerStateRecorder.GetPlayerStation(e.Timestamp) }, { "isCurrentShip", false } } }; yield return(@event); // and for new, indicating that it's now current @event = new ApiEvent("setCommanderShip") { Timestamp = e.Timestamp, EventData = new Dictionary <string, object>() { { "shipType", e.ShipType }, { "shipGameID", e.ShipId }, { "marketID", e.MarketId }, { "starsystemName", playerStateRecorder.GetPlayerSystem(e.Timestamp) }, { "stationName", playerStateRecorder.GetPlayerStation(e.Timestamp) }, { "isCurrentShip", true } } }; yield return(@event); }
private void ApplyShipyardSwap(ShipyardSwap shipyardSwap) { _tracker.Modify(shipyardSwap.Timestamp, ship => { ship.Type = shipyardSwap.ShipType; ship.ShipId = shipyardSwap.ShipID; }); }
internal ShipyardSwapEvent InvokeEvent(ShipyardSwapEvent arg) { if (_api.ValidateEvent(arg)) { ShipyardSwap?.Invoke(_api, arg); } return(arg); }
private void Process(ShipyardSwap e) => ProcessShipIDEvent(e.ShipId, e.ShipType, e.Timestamp);