public void FinalizeOfferPartially(AssetsOwner buyer, int partialAmmount) // TODO: test it! { if (partialAmmount >= Ammount) { throw new ApplicationException(); } decimal moneyToTransfer = PricePerPiece * partialAmmount; buyer.TransferMoney(Seller, moneyToTransfer); Ammount -= partialAmmount; buyer.commodityStorage.Deposit(Commodity, partialAmmount); }
public void FinalizeOffer(AssetsOwner buyer) // TODO: test it! { if (finalized) { throw new ApplicationException(); } finalized = true; decimal moneyToTransfer = PricePerPiece * Ammount; buyer.TransferMoney(Seller, moneyToTransfer); buyer.commodityStorage.Deposit(Commodity, Ammount); }