Example #1
0
 internal ShipyardEvent InvokeEvent(ShipyardEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         Shipyard?.Invoke(_api, arg);
     }
     return(arg);
 }
 private static void AssertEvent(ShipyardEvent @event)
 {
     Assert.NotNull(@event);
     Assert.Equal(DateTime.Parse("2019-08-29T13:42:34Z"), @event.Timestamp);
     Assert.Equal(EventName, @event.Event);
     Assert.Equal("Mawson Dock", @event.StationName);
     Assert.Equal(128932277, @event.MarketId);
     Assert.Equal("Dromi", @event.StarSystem);
 }
        private IEnumerable <EddnEvent> ConvertShipyardEvent(Shipyard e, string commanderName)
        {
            if (e.Prices == null || e.Prices.Length == 0)
            {
                yield break;
            }

            var @event = new ShipyardEvent
            {
                Header  = CreateHeader(commanderName),
                Message = new ShipyardMessage
                {
                    StationName = e.StationName,
                    SystemName  = e.StarSystem,
                    MarketId    = e.MarketId,
                    Timestamp   = e.Timestamp,
                    Ships       = e.Prices.Select(p => p.ShipType).ToArray()
                }
            };

            yield return(@event);
        }
        private static void AssertFileEvent(ShipyardEvent @event)
        {
            Assert.NotNull(@event);
            Assert.Equal(DateTime.Parse("2019-09-01T13:03:07Z"), @event.Timestamp);
            Assert.Equal(EventName, @event.Event);
            Assert.Equal("Wrangell Dock", @event.StationName);
            Assert.Equal(3223388416, @event.MarketId);
            Assert.Equal("Ross 584", @event.StarSystem);
            Assert.True(@event.Horizons);
            Assert.False(@event.AllowCobraMkIV);
            Assert.Equal(15, @event.Prices.Length);

            Assert.Equal(128049249, @event.Prices[0].Id);
            Assert.Equal("sidewinder", @event.Prices[0].ShipType);
            Assert.Equal(ShipModel.Sidewinder, @event.Prices[0].ShipModel);
            Assert.Null(@event.Prices[0].ShipTypeLocalised);
            Assert.Equal(27200, @event.Prices[0].ShipPrice);

            Assert.Equal(128049333, @event.Prices[14].Id);
            Assert.Equal("type9", @event.Prices[14].ShipType);
            Assert.Equal(ShipModel.Type9Heavy, @event.Prices[14].ShipModel);
            Assert.Equal("Type-9 Heavy", @event.Prices[14].ShipTypeLocalised);
            Assert.Equal(65072466, @event.Prices[14].ShipPrice);
        }
Example #5
0
 internal void InvokeShipyardEvent(ShipyardEvent arg)
 {
     ShipyardEvent?.Invoke(this, arg);
 }
Example #6
0
 internal void InvokeShipyardEvent(ShipyardEvent arg) => ShipyardEvent?.Invoke(null, arg);