Beispiel #1
0
 public void offerSuccess(COfferToBuy otb, double q)
 {
     commodityInStore += q;
     otb.quantity     -= q;
     currentOffers.Remove(otb.objectID);
     lastPurchase = CMainTicker.gameDateTime;
 }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 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);
     }
 }
Beispiel #4
0
 public void offerToBuy(COfferToBuy otb)
 {
     forOfferDict.Add(otb.objectID, otb);
 }