Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 private void ApplyShipyardSwap(ShipyardSwap shipyardSwap)
 {
     _tracker.Modify(shipyardSwap.Timestamp, ship =>
     {
         ship.Type   = shipyardSwap.ShipType;
         ship.ShipId = shipyardSwap.ShipID;
     });
 }
Ejemplo n.º 3
0
 internal ShipyardSwapEvent InvokeEvent(ShipyardSwapEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         ShipyardSwap?.Invoke(_api, arg);
     }
     return(arg);
 }
Ejemplo n.º 4
0
 private void Process(ShipyardSwap e) => ProcessShipIDEvent(e.ShipId, e.ShipType, e.Timestamp);