Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var zero   = new Zero();
            var tesla  = new Tesla();
            var cessna = new Cessna();
            var ram    = new Ram();

            zero.MainColor         = "White";
            tesla.MainColor        = "Red";
            cessna.MainColor       = "BabyPuke Green";
            ram.MainColor          = "Seafoam";
            tesla.MaximumOccupancy = 5;

            zero.Drive();
            tesla.Drive();
            cessna.Drive();
            ram.Drive();

            zero.Turn();
            tesla.Turn();
            cessna.Turn();
            ram.Turn();

            zero.Stop();
            tesla.Stop();
            cessna.Stop();
            ram.Stop();
        }
        static void Main(string[] args)
        {
            Vehicle fxs = new Zero()
            {
                BatteryKWh       = 400,
                MainColor        = "green",
                MaximumOccupancy = "5 Passengers"
            };
            Vehicle modelS = new Tesla()
            {
                BatteryKWh       = 650,
                MainColor        = "blue",
                MaximumOccupancy = "5 Passengers"
            };
            Vehicle mx410 = new Cessna()
            {
                FuelCapacity     = 325,
                MainColor        = "white",
                MaximumOccupancy = "2 Passengers"
            };
            Vehicle f250 = new Ram()
            {
                FuelCapacity     = 275,
                MainColor        = "black",
                MaximumOccupancy = "6 Passengers"
            };

            fxs.Drive();
            modelS.Drive();
            mx410.Drive();
            f250.Drive();

            fxs.Stop();
            modelS.Stop();
            mx410.Stop();
            f250.Stop();

            fxs.Turn("left");
            modelS.Turn("right");
            mx410.Turn("left");
            f250.Turn("right");
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            var cessna = new Cessna()
            {
                MainColor        = "white",
                MaximumOccupancy = 5,
                FuelCapacity     = 2.3
            };
            var ram = new Ram()
            {
                MainColor        = "blue",
                MaximumOccupancy = 6,
                FuelCapacity     = 5.4
            };
            var tesla = new Tesla()
            {
                MainColor        = "black",
                MaximumOccupancy = 5,
                BatteryKWh       = 2.3
            };
            var zero = new Zero()
            {
                MainColor        = "silver",
                MaximumOccupancy = 2,
                BatteryKWh       = 4.3
            };

            cessna.Drive();
            cessna.Turn();
            cessna.Stop();
            ram.Drive();
            ram.Turn();
            ram.Stop();
            tesla.Drive();
            tesla.Turn();
            tesla.Stop();
            zero.Drive();
            zero.Turn();
            zero.Stop();
        }