Example #1
0
 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
     }
 }
Example #2
0
 public FiveEuroHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #3
0
 public TenEuroHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #4
0
 public TwentyEuroHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #5
0
 public HundredEuroHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #6
0
 protected EuroHandlerBase(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #7
0
 public OneDollarHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #8
0
 public FiveThousandRubleHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #9
0
 public HundredDollarHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #10
0
 protected DollarHandlerBase(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #11
0
 public TenRubleHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #12
0
 public FiftyRubleHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #13
0
 public FiveHundredRubleHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #14
0
 public ThousandDRubleHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #15
0
 protected BanknoteHandler(BanknoteHandler nextHandler)
 {
     _nextHandler = nextHandler;
 }
Example #16
0
 public TwentyDollarHandler(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
Example #17
0
 protected RubleHandlerBase(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }