static void Main(string[] args)
        {
            //Making new classees
            Cessna cessna = new Cessna();
            Ram    ram    = new Ram();
            Tesla  tesla  = new Tesla();
            Zero   zero   = new Zero();

            cessna.MainColor = "Black";
            ram.MainColor    = "White";
            tesla.MainColor  = "Blue";
            zero.MainColor   = "Red";

            cessna.Drive();
            cessna.Turn("west");
            cessna.Stop();

            ram.Drive();
            ram.Turn("east");
            ram.Stop();

            tesla.Drive();
            tesla.Turn("right");
            tesla.Stop();

            zero.Drive();
            zero.Turn("left");
            zero.Stop();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            var myBike = new Zero();

            myBike.MainColor    = "Black";
            myBike.MaxOccupancy = 2;

            var myTesla = new Tesla();

            myTesla.MainColor    = "Midnight Silver";
            myTesla.MaxOccupancy = 6;

            var myRam = new Ram();

            myRam.MainColor = "Raging Red";

            var myCessna = new Cessna();

            myCessna.MainColor = "White";

            myBike.Drive();
            myBike.Turn("down for what");
            myBike.Stop();
            myTesla.Drive();
            myTesla.Turn("left");
            myTesla.Stop();
            myRam.Drive();
            myRam.Turn("right");
            myRam.Stop();
            myCessna.Drive();
            myCessna.Turn("up");
            myCessna.Stop();
        }
        static void Main(string[] args)
        {
            var myBike = new Zero();

            // I can still reference the inherited property
            myBike.MainColor        = "Black";
            myBike.MaximumOccupancy = 2;
            myBike.BatteryKWh       = 4.523;

            var myTesla = new Tesla();

            myTesla.MainColor        = "Midnight Silver";
            myTesla.MaximumOccupancy = 6;
            myTesla.BatteryKWh       = 3.221;

            var myCessna = new Cessna();

            myCessna.MainColor        = "Sky Blue";
            myCessna.MaximumOccupancy = 12;
            myCessna.FuelCapacity     = 52.5;

            var myRam = new Ram();

            myRam.MainColor        = "Red";
            myRam.MaximumOccupancy = 5;
            myRam.FuelCapacity     = 40.25;

            myBike.Drive();
            myBike.Turn("right");
            myBike.Stop();
            Console.WriteLine("");
            myTesla.Drive();
            myTesla.Turn("left");
            myTesla.Stop();
            Console.WriteLine("");
            myCessna.Drive();
            myCessna.Turn("up");
            myCessna.Stop();
            Console.WriteLine("");
            myRam.Drive();
            myRam.Turn("right");
            myRam.Stop();
            Console.WriteLine("");
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Zero fxs = new Zero()
            {
                MainColor        = "Midnight Blue",
                MaximumOccupancy = "4",
                BatteryKWh       = 25.50
            };
            Zero fxs2 = new Zero()
            {
                MainColor        = "Black",
                MaximumOccupancy = "4",
                BatteryKWh       = 25.50
            };
            Tesla modelS = new Tesla()
            {
                MainColor        = "Burgundy",
                MaximumOccupancy = "4",
                BatteryKWh       = 44.00
            };
            Cessna mx410 = new Cessna()
            {
                MainColor        = "White",
                MaximumOccupancy = "4",
                FuelCapacity     = 89.50
            };
            Ram ram1500 = new Ram()
            {
                MainColor        = "Silver",
                MaximumOccupancy = "4",
                FuelCapacity     = 20.00
            };

            List <IElectricVehicle> ElectricVehicles = new List <IElectricVehicle>();
            List <IGasVehicle>      GasVehicles      = new List <IGasVehicle>();

            ElectricVehicles.Add(fxs);
            ElectricVehicles.Add(fxs2);
            ElectricVehicles.Add(modelS);

            GasVehicles.Add(mx410);
            GasVehicles.Add(ram1500);

            fxs.Drive();
            fxs.Turn();
            fxs.Stop();
            fxs2.Drive();
            fxs2.Turn();
            fxs2.Stop();
            modelS.Drive();
            modelS.Turn();
            modelS.Stop();
            mx410.Drive();
            mx410.Turn();
            mx410.Stop();
            ram1500.Drive();
            ram1500.Turn();
            ram1500.Stop();

            BatteryStation batteryStation = new BatteryStation();

            batteryStation.Refuel(ElectricVehicles);

            GasStation gasStation = new GasStation();

            gasStation.Refuel(GasVehicles);
        }