public List <int> Handle(int money, CurrencyType type, List <int> banknotes) { if (type != _type) { return(_nextHandler.Handle(money, type, banknotes)); } while (money - _banknoteValue >= 0) { money -= _banknoteValue; banknotes.Add(_banknoteValue); } return(_nextHandler.Handle(money, type, banknotes)); }
public List <int> GiveMoney(int money, CurrencyType type) { return(_handler.Handle(money, type, new List <int>())); }