Exemplo n.º 1
0
 internal ShipyardBuyEvent InvokeEvent(ShipyardBuyEvent arg)
 {
     if (_api.ValidateEvent(arg))
     {
         ShipyardBuy?.Invoke(_api, arg);
     }
     return(arg);
 }
 private static void AssertEvent(ShipyardBuyEvent @event)
 {
     Assert.NotNull(@event);
     Assert.Equal(DateTime.Parse("2019-08-30T14:10:31Z"), @event.Timestamp);
     Assert.Equal(EventName, @event.Event);
     Assert.Equal("adder", @event.ShipType);
     Assert.Equal(ShipModel.Adder, @event.ShipModel);
     Assert.Equal(87808, @event.ShipPrice);
     Assert.Equal("SideWinder", @event.StoreOldShip);
     Assert.Equal(0, @event.StoreShipId);
     Assert.Equal(3223919616, @event.MarketId);
 }
        private async void StationOnShipyardBuyAsync(object sender, ShipyardBuyEvent e)
        {
            var request = StartRequest();

            if (e.StoreShipId.HasValue)
            {
                AddCommand(new SetCommanderShip(e.StoreOldShip, e.StoreShipId.Value)
                {
                    StarSystem = _eliteAPI.Location?.StarSystem?.Name, Station = _eliteAPI.Location?.Station?.Name
                });
            }
            else if (e.SellShipID.HasValue)
            {
                AddCommand(new RemoveCommanderShip(e.SellOldShip, e.SellShipID.Value));
            }

            await request.SendAsync().ConfigureAwait(false);
        }
Exemplo n.º 4
0
 internal void InvokeShipyardBuyEvent(ShipyardBuyEvent arg)
 {
     ShipyardBuyEvent?.Invoke(this, arg);
 }
Exemplo n.º 5
0
 internal void InvokeShipyardBuyEvent(ShipyardBuyEvent arg) => ShipyardBuyEvent?.Invoke(null, arg);