public void offerSuccess(COfferToBuy otb, double q) { commodityInStore += q; otb.quantity -= q; currentOffers.Remove(otb.objectID); lastPurchase = CMainTicker.gameDateTime; }
public void makeOfferToBuy() { COfferToBuy otb = new COfferToBuy(); otb.myConsumer = this; otb.onMarketAt = CMainTicker.gameDateTime; otb.offeredPrice = offeredPrice(); otb.quantity = purchaseQuantity; otb.expires = CMainTicker.gameDateTime.AddDays(5); currentOffers.Add(otb.objectID, otb); myMarket.offerToBuy(otb); }
void sellTo(COfferToBuy otb, CCommodity cm) { if (otb.quantity >= cm.quantity) { otb.myConsumer.offerSuccess(otb, cm.quantity); cm.myProducer.sold(cm, cm.quantity); } else { cm.myProducer.sold(cm, otb.quantity); otb.myConsumer.offerSuccess(otb, otb.quantity); } }
public void offerToBuy(COfferToBuy otb) { forOfferDict.Add(otb.objectID, otb); }