コード例 #1
0
 public Bancomat()
 {
     _handler = new HundredDollarHandler(null);
     _handler = new FiftyDollarHandler(_handler);
     _handler = new TenDollarHandler(_handler);
     _handler = new TenRubleHandler(_handler);
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: IRemsha/Design-Patterns
 public Bancomat(CurrencyType type)
 {
     _type    = type;
     _handler = new BanknoteHandler(null, 20, _type);
     _handler = new BanknoteHandler(_handler, 50, _type);
     _handler = new BanknoteHandler(_handler, 200, _type);
     _handler = new BanknoteHandler(_handler, 1000, _type);
 }
コード例 #3
0
        public Bancomat()
        {
            _handler = new ErrorHandler(null);

            _handler = new FiveEuroHandler(_handler);
            _handler = new TenEuroHandler(_handler);
            _handler = new TwentyEuroHandler(_handler);
            _handler = new FiftyEuroHandler(_handler);
            _handler = new HundredEuroHandler(_handler);

            _handler = new TenRubleHandler(_handler);
            _handler = new FiftyRubleHandler(_handler);
            _handler = new HundredRubleHandler(_handler);
            _handler = new ThousandRubleHandler(_handler);

            _handler = new FiveDollarHandler(_handler);
            _handler = new TenDollarHandler(_handler);
            _handler = new TwentyDollarHandler(_handler);
            _handler = new FiftyDollarHandler(_handler);
            _handler = new HundredDollarHandler(_handler);
        }
コード例 #4
0
 protected EuroHandlerBase(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
コード例 #5
0
 protected RubelesHandlerBase(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }
コード例 #6
0
 protected DollarHandlerBase(BanknoteHandler nextHandler) : base(nextHandler)
 {
 }