public MainChainOfResponsabilityProgram()
        {
            this.BikeCapacity = new BikeCapacity(1);
            this.CarCapacity = new CarCapacity(5);
            this.BusCapacity = new BusCapacity(40);

            BikeCapacity.SetSuccessor(CarCapacity);
            CarCapacity.SetSuccessor(BusCapacity);
        }
Ejemplo n.º 2
0
 public void SetSuccessor(VehicleCapacity successor)
 {
     this.Successor = successor;
 }