public virtual IEnumerable <IBanknote> ToIssueBanknotes(uint value, CurrencyType type)
        {
            if (value == 0)
            {
                return(Enumerable.Empty <IBanknote>());
            }
            if (type != Banknote.Type)
            {
                return(_nextHandler.ToIssueBanknotes(value, type));
            }
            var howManyTimes = (int)value / (int)Banknote.Value; // Опасное место, понимаю

            return(Enumerable.Repeat(Banknote, howManyTimes)
                   .Concat(_nextHandler.ToIssueBanknotes(value % Banknote.Value, type)));
        }
Beispiel #2
0
 public IEnumerable <IBanknote> ToIssueBanknotes(uint value, CurrencyType type)
 {
     return(_nextHandler.ToIssueBanknotes(value, type));
 }