public Bancomat(IBanknote banknote) { if (banknote is Dollar) { _handler = new OneDollarHandler(null); // 1 _handler = new TwoDollarHandler(_handler); // 2 _handler = new FiveDollarHandler(_handler); // 5 _handler = new TenDollarHandler(_handler); // 10 _handler = new TwentyDollarHandler(_handler); // 20 _handler = new FiftyDollarHandler(_handler); // 50 _handler = new HundredDollarHandler(_handler); // 100 } else if (banknote is Euro) { _handler = new FiveEuroHandler(null); // 5 _handler = new TenEuroHandler(_handler); // 10 _handler = new TwentyEuroHandler(_handler); // 20 _handler = new FiftyEuroHandler(_handler); // 50 _handler = new HundredEuroHandler(_handler); // 100 _handler = new TwoHundredEuroHandler(_handler); // 200 _handler = new FiveHundredEuroHandler(_handler); // 500 } else if (banknote is Ruble) { _handler = new TenRubleHandler(null); // 10 _handler = new FiftyRubleHandler(_handler); // 50 _handler = new HundredRubleHandler(_handler); // 100 _handler = new FiveHundredRubleHandler(_handler); // 500 _handler = new ThousandDRubleHandler(_handler); // 1000 _handler = new FiveThousandRubleHandler(_handler); // 5000 } }
public FiveEuroHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public TenEuroHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public TwentyEuroHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public HundredEuroHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
protected EuroHandlerBase(BanknoteHandler nextHandler) : base(nextHandler) { }
public OneDollarHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public FiveThousandRubleHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public HundredDollarHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
protected DollarHandlerBase(BanknoteHandler nextHandler) : base(nextHandler) { }
public TenRubleHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public FiftyRubleHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public FiveHundredRubleHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
public ThousandDRubleHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
protected BanknoteHandler(BanknoteHandler nextHandler) { _nextHandler = nextHandler; }
public TwentyDollarHandler(BanknoteHandler nextHandler) : base(nextHandler) { }
protected RubleHandlerBase(BanknoteHandler nextHandler) : base(nextHandler) { }