public override void OnInit(IEconomyTraderProxy marketTraderProxy) { base.OnInit(marketTraderProxy); _population = 100; MarketTraderProxy.AddGoods(CityExample.Food, Population); MarketTraderProxy.AddMoney(Population); }
protected void Produce(IEconomyTraderProxy proxy, Good good, float amount, float chance = 1f) { if (chance >= 1f || ThreadStaticRandomProvider.Instance.NextDouble() < chance) { proxy.AddGoods(good, amount); } }
public TraderEventArgs(IEconomyTraderProxy traderProxy) { TraderProxy = traderProxy; }
public override void OnInit(IEconomyTraderProxy marketTraderProxy) { Contract.Requires(marketTraderProxy != null && marketTraderProxy.Active); Contract.Ensures(MarketTraderProxy != null); base.OnInit(marketTraderProxy); }
public virtual void OnInit(IEconomyTraderProxy marketTraderProxy) { MarketTraderProxy = marketTraderProxy; }
public void OnInit(IEconomyTraderProxy marketTraderProxy) { Contract.Requires<ArgumentNullException>(marketTraderProxy != null); Contract.Requires<InvalidOperationException>(marketTraderProxy.Active); throw new NotImplementedException(); }