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