Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Personnel A = new Personnel {
                Name = "Ricardo", Rank = "SGT", Location = "Quantico"
            };
            Personnel B = new Personnel {
                Name = "Michael", Rank = "SSG", Location = "Fort Bragg"
            };
            Personnel Be = new Personnel {
                Name = "James", Rank = "SGT", Location = "Quantico"
            };

            Console.WriteLine($"Names is {A.Name}, My Rank is {A.Rank} and I am located in {A.Location}");
            Console.WriteLine($"Names is {B.Name}, My Rank is {B.Rank} and I am located in {B.Location}");
            Console.WriteLine($"Names is {Be.Name}, My Rank is {Be.Rank} and I am located in {Be.Location}");

            Missions Aa = new Missions {
                Name = "Eagles", DeadLine = "0800", Location = "Korea"
            };
            Missions Bb = new Missions {
                Name = "HashBack", DeadLine = "2000", Location = "Fort Bragg"
            };
            Missions c = new Missions {
                Name = "Zellow", DeadLine = "2300", Location = "Quantico"
            };

            Console.WriteLine($"Mission is {Aa.Name}, My DeadLine is {Aa.DeadLine} and I am located in {Aa.Location}");
            Console.WriteLine($"Misssion is {Bb.Name}, My DeadLine is {Bb.DeadLine} and I am located in {Bb.Location}");
            Console.WriteLine($"Mission is {c.Name}, My DeadLine is {c.DeadLine} and I am located in {c.Location}");

            Vehicles V = new Vehicles {
                Make = "MATV", Model = "1028C", Type = "Ground Vehicle"
            };

            Console.WriteLine($"I Am a {V.Make}, My Model is {V.Model} and I am a {V.Type}");
        }
Exemplo n.º 2
0
        static void group()
        {
            vehicles  Vec = new vehicles();
            weapons   Wep = new weapons();
            mission   Mis = new mission();
            Personnel Per = new Personnel();

            string name  = "";
            bool   check = false;

            while (check == false)
            {
                Console.WriteLine("\nSelect from the following Mission options below.");
                Console.Write("1. Airbore Operation " + "2. Hostage Rescue " + "3. Resuplly Mission " + "4. Medivac the wounded " + "5. Testing polymorphism " + "6. Quit");
                Console.Write("\nMy option is: ");
                name = Console.ReadLine();
                switch (name)
                {
                case "1":
                    Console.Clear();
                    Mis.Deploy("Lets Go!!!");

                    Console.WriteLine("\nMission Brief:");
                    Mis.AirborneOp();
                    Vec.HMWVV();
                    Wep.M240B();
                    Per.Intel();
                    Wep.Fought();

                    Mis.ComeHome("About Time!!");

                    check = false;
                    break;

                case "2":
                    Console.Clear();
                    Mis.Deploy("Lets Go!!!");

                    Console.WriteLine("\nMission Brief:");
                    Mis.HostageRescue();
                    Vec.FootPatrol();
                    Wep.M4();
                    Per.Infantry();
                    Mis.Fought();

                    Mis.ComeHome("About Time!!");

                    check = false;
                    break;

                case "3":
                    Console.Clear();
                    Mis.Deploy("Lets Go!!!");

                    Console.WriteLine("\nMission Brief:");
                    Mis.Resupply();
                    Vec.Tank();
                    Wep.TankRound();
                    Per.Supply();
                    Vec.Fought();

                    Mis.ComeHome("About Time!!");

                    check = false;
                    break;

                case "4":
                    Console.Clear();
                    Mis.Deploy("Lets Go!!!");

                    Console.WriteLine("\nMission Brief:");
                    Mis.Medivac();
                    Vec.LMTV();
                    Wep.M9();
                    Per.Medics();
                    Per.Fought();

                    Mis.ComeHome("About Time!!");

                    check = false;
                    break;

                case "5":
                    Console.Clear();

                    Console.WriteLine("\nTesting polymorphism:\n");
                    Military v = Wep;
                    v.Fought();
                    v = Mis;
                    v.Fought();
                    v = Vec;
                    v.Fought();
                    v = Per;
                    v.Fought();


                    check = false;
                    break;

                case "6":
                    Console.Clear();
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\nThanks for playing. Duces (>^_^>) (<^_^<)\n");

                    check = true;
                    break;

                default:
                    Console.Clear();
                    Console.WriteLine("Invalid Selection");
                    check = false;
                    break;
                }
            }
        }
Exemplo n.º 3
0
 static void GoOnMission(Personnel personnel, Vehicles vehicle)
 {
     vehicle.Drive();
     vehicle.BreakDown();
     vehicle.Stop();
 }