Ejemplo n.º 1
0
        public void XBuy(Action onBought, int price, int amount)
        {
            this.onBought = onBought;
            XBuyMarketItemEvent eventInstance = new XBuyMarketItemEvent {
                Price  = price,
                Amount = amount
            };

            EngineService.Engine.NewEvent(eventInstance).Attach(SelfUserComponent.SelfUser).Attach(this.MarketItem).Schedule();
        }
Ejemplo n.º 2
0
 public void BuyContainers(BuySelectedContainerItemEvent evt, ButtonNode buyButton, ContainerUserItemNode containerUserItem, [JoinByMarketItem] ContainerMarketItemNode containerMarketItem, [JoinAll] SelfUserNode userNode)
 {
     if (buyButton.universalPriceButton.XPriceActivity)
     {
         XBuyMarketItemEvent eventInstance = new XBuyMarketItemEvent {
             Amount = buyButton.itemPackButton.Count,
             Price  = (int)buyButton.priceButton.Price
         };
         Entity[] entities = new Entity[] { containerMarketItem.Entity, userNode.Entity };
         base.NewEvent(eventInstance).AttachAll(entities).Schedule();
     }
     else if (buyButton.universalPriceButton.PriceActivity)
     {
         BuyMarketItemEvent eventInstance = new BuyMarketItemEvent {
             Amount = buyButton.itemPackButton.Count,
             Price  = (int)buyButton.priceButton.Price
         };
         Entity[] entities = new Entity[] { containerMarketItem.Entity, userNode.Entity };
         base.NewEvent(eventInstance).AttachAll(entities).Schedule();
     }
 }