public void Buy() { RecomputeTrade(); TradeEvent trade = (new TradeEvent() { GoodsReceived = GoodsReceived, GoodsSent = GoodsSent, LikedThings = TheirGoods.LikedThings, HatedThings = TheirGoods.HatedThings, RareThings = TheirGoods.RareThings, CommonThings = TheirGoods.CommonThings, MoneyReceived = TheirTrades.MoneyEdit.CurrentMoney, MoneySent = MyTrades.MoneyEdit.CurrentMoney }); OnTraded.Invoke(trade); }
void dialog_OnClicked(TradeEvent e) { LastEvent = e; }
void TradePanel_OnTraded(TradeEvent e) { OnTraded.Invoke(e); Close(ReturnStatus.Ok); }
public void DoTrade(TradeEvent trade) { PlayerFation.RemoveResources(trade.GoodsSent, Vector3.Zero, false); foreach (ResourceAmount resource in trade.GoodsReceived) { PlayerFation.AddResources(resource); } }
void shoppingCart_OnItemChanged(GItem item) { TradeEvent trade = new TradeEvent() {GoodsReceived = GoodsReceived, GoodsSent = GoodsSent}; float total = trade.GetProfit().TotalProfit; BuyTotal.Text = "Total Profit: " + (total).ToString("C"); }
protected virtual void OnOnTraded(TradeEvent e) { OnTrade handler = OnTraded; if (handler != null) handler(e); }