public MainChainOfResponsabilityProgram() { this.BikeCapacity = new BikeCapacity(1); this.CarCapacity = new CarCapacity(5); this.BusCapacity = new BusCapacity(40); BikeCapacity.SetSuccessor(CarCapacity); CarCapacity.SetSuccessor(BusCapacity); }
public void SetSuccessor(VehicleCapacity successor) { this.Successor = successor; }