public static void Main()
 {
     Bicycle myBycicle = new Bicycle();
     Car myCar = new Car();
     Truck myTruck = new Truck();
     myBycicle.SetSuccessor(myCar);
     myCar.SetSuccessor(myTruck);
     Bagage myBagage = new Bagage(222);
     myBycicle.RequestToTransport(myBagage);
 }
Exemplo n.º 2
0
 public override void RequestToTransport(Bagage bagage)
 {
     if (bagage.Weight < 10)
     {
         Console.WriteLine("Bagage transported by " + this.ToString());
     }
     else if (this.Successor != null)
     {
         this.Successor.RequestToTransport(bagage);
     }
 }
Exemplo n.º 3
0
 public override void RequestToTransport(Bagage bagage)
 {
     if (bagage.Weight < 100)
     {
         Console.WriteLine("Bagage transported by " + this.ToString());
     }
     else if (this.Successor != null)
     {
         this.Successor.RequestToTransport(bagage);
     }
 }
        public static void Main()
        {
            Bicycle myBycicle = new Bicycle();
            Car     myCar     = new Car();
            Truck   myTruck   = new Truck();

            myBycicle.SetSuccessor(myCar);
            myCar.SetSuccessor(myTruck);
            Bagage myBagage = new Bagage(222);

            myBycicle.RequestToTransport(myBagage);
        }
Exemplo n.º 5
0
 public abstract void RequestToTransport(Bagage bagage);
Exemplo n.º 6
0
 public abstract void RequestToTransport(Bagage bagage);