コード例 #1
0
        public string RemoveSupplies(CoffeeBase coffee, int quantity)
        {
            string message = "success";

            if (!AvailableSupplies.ContainsKey(coffee.GetType().FullName) || AvailableSupplies[coffee.GetType().FullName] - quantity < 0)
            {
                message = $"Not Enough Supplies For Type : {coffee.GetType().Name}";
            }

            AvailableSupplies[coffee.GetType().FullName] -= quantity;

            return(message);
        }
コード例 #2
0
 public void ReturnSupplies(CoffeeBase coffee, int quantity)
 {
     AvailableSupplies[coffee.GetType().FullName] += quantity;
 }