Ejemplo n.º 1
0
        private static void TestVehicleAmphibian()
        {
            Motor     motor     = new Motor(FuelType.Oil, 350);
            Amphibian amphibian = new Amphibian(2, 6, motor);

            amphibian.Start();
            Console.WriteLine(amphibian.ToString());

            amphibian.IncreaseSpeed(20);
            amphibian.IncreaseSpeed(10);
            amphibian.IncreaseSpeed(30);
            Console.WriteLine(amphibian.ToString());

            amphibian.GetIntoWater();
            Console.WriteLine(amphibian.ToString());

            amphibian.DecreaseSpeed(15);
            Console.WriteLine(amphibian.ToString());

            amphibian.GetOntoGround();
            Console.WriteLine(amphibian.ToString());

            amphibian.Stop();
            Console.WriteLine(amphibian.ToString());
        }
Ejemplo n.º 2
0
        private static void TestAmphibian()
        {
            OilMotor  motor     = new OilMotor(650);
            Amphibian amphibian = new Amphibian(500, 4, motor);

            Console.WriteLine("Amphibian:");
            amphibian.Start();
            amphibian.Accelerate(30);
            Console.WriteLine(amphibian.ToString());

            amphibian.GetIntoWater();
            amphibian.Accelerate(10);
            Console.WriteLine(amphibian.ToString());

            amphibian.Decelerate(5);
            amphibian.GetOntoGround();
            Console.WriteLine(amphibian.ToString());

            amphibian.Stop();
        }