Supermarket.Checkout.Pay C# (CSharp) Method

Pay() public method

Transfers the given amount of money to this checkout.
public Pay ( float amount ) : void
amount float The amount of money to give to this checkout
return void
        public void Pay(float amount)
        {
            money += amount;
            supermarket.Deposit(amount);
        }

Usage Example

コード例 #1
0
 /// <summary>
 /// Makes the customer give money to the given checkout. The money is subtracted from the customers wallet
 /// </summary>
 /// <param name="checkout">The checkout to pay the money to</param>
 public void Pay(Checkout checkout)
 {
     checkout.Pay(inventory.TotalCost);
 }