Example #1
0
 public void JoinUserContainerToMarketContainer(NodeAddedEvent e, ContainerUserItemNode userContainer, [JoinByMarketItem] Optional <ContainerMarketItemWithGroupNode> marketContainer)
 {
     if (marketContainer.IsPresent())
     {
         marketContainer.Get().containerGroup.Attach(userContainer.Entity);
     }
     else
     {
         userContainer.Entity.CreateGroup <ContainerGroupComponent>();
     }
 }
Example #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();
     }
 }