示例#1
0
 /// <summary>
 /// executes the trade if IsClosed flag indicates a closed trade, should only be called after buyer confirmation
 /// </summary>
 public void MakeTrade()
 {
     if (IsClosed == true)
     {
         TradeDate = DateTime.UtcNow;
         Buyer.AddCardToInventory(OfferCard);
         Offerer.AddCardToInventory(BuyerCard);
         Buyer.RemoveCardFromInventory(BuyerCard);
         Offerer.RemoveCardFromInventory(OfferCard);
     }
     else
     {
         throw new Exception("trade is not closed.");
     }
 }