Beispiel #1
0
        public void Run()
        {
            var finance  = new Finance();
            var infantry = new Infantry("SSG", "Brooks");
            var signal   = new Signal("SGT", "Lee");

            var soldiers = new List <Soldier>()
            {
                finance, infantry, signal
            };

            foreach (var solder in soldiers)
            {
                SoldierAction(solder);
            }
        }
Beispiel #2
0
        public void Run()
        {
            var infantry  = new Infantry();
            var medical   = new Medical();
            var artillery = new Artillery();


            var personnels = new List <Personnel>()
            {
                infantry, medical, artillery
            };

            foreach (var personnel in personnels)
            {
                DoPersonnelStuff(personnel);
            }
        }
Beispiel #3
0
        public void Run()
        {
            //weapons
            var fiftyCal        = new FiftyCal();
            var grenadeLauncher = new GrenadeLauncher();
            var m4 = new M4();
            var m9 = new M9();

            //vehicles
            var c130 = new C130();
            var c17  = new C17();
            var humv = new HUMV();
            var lmtv = new LMTV();

            //soldiers
            var specOps  = new SpecOps();
            var regular  = new Regular();
            var infantry = new Infantry();
            var pogs     = new POGS();

            Console.WriteLine("These are the general specifications of components inside a Military Unit.");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Weapons.");
            Console.WriteLine("___________________________________________________________________________________________________________________");
            Console.WriteLine($"The {fiftyCal.weaponName} has a caliber of {fiftyCal.weaponCaliber} with a weight of {fiftyCal.weaponWeight} pounds.");
            Console.WriteLine($"The {grenadeLauncher.weaponName} has a caliber of {grenadeLauncher.weaponCaliber} with a weight of {grenadeLauncher.weaponWeight} poundsb.");
            Console.WriteLine($"The {m4.weaponName} has a caliber of {m4.weaponCaliber} with a weight of {m4.weaponWeight} pounds.");
            Console.WriteLine($"The {m9.weaponName} has a caliber of {m9.weaponCaliber} with a weight of {m9.weaponWeight} pounds.");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Vehicles");
            Console.WriteLine("___________________________________________________________________________________________________________________");
            Console.WriteLine($"The {c130.vehicleName} uses the fuel {c130.vehicleFuel} and can carry {c130.vehiclePassengers} people.");
            Console.WriteLine($"The {c17.vehicleName} uses the fuel {c17.vehicleFuel} and can carry {c17.vehiclePassengers} people.");
            Console.WriteLine($"The {humv.vehicleName} uses the fuel {humv.vehicleFuel} and can carry {humv.vehiclePassengers} people.");
            Console.WriteLine($"The {lmtv.vehicleName} uses the fuel {lmtv.vehicleFuel} and can carry {lmtv.vehiclePassengers} people.");
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("Soldiers");
            Console.WriteLine("___________________________________________________________________________________________________________________");
            Console.WriteLine($"There is a soldier with the job of {specOps.soldierJob}");
            Console.WriteLine($"There is a soldier with the job of {regular.soldierJob}");
            Console.WriteLine($"There is a soldier with the job of {infantry.soldierJob}");
            Console.WriteLine($"There is a soldier with the job of {pogs.soldierJob}");
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            //build a unit
            HR       susan  = new HR();
            Infantry bob    = new Infantry();
            Medic    jeff   = new Medic();
            Cook     ashley = new Cook();

            Console.WriteLine("Hello and welcome to the Army");
            Console.WriteLine("Let me introduce you to the unit");
            Console.WriteLine();

            //Call the animals
            susan.Talk();
            bob.Talk();
            jeff.Talk();
            ashley.Talk();
            //our custom animal
            newSoldier();
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Console.WriteLine("\r\nGear up we got a mission!");

            Platoon plt = new Platoon();

            plt.GetInfo();
            Console.ReadLine();


            Console.WriteLine("Lets review the mission details\r\n" +
                              "1: Easy Mission\r\n" +
                              "2: Hard Mission");
            int missionChoice = int.Parse(Console.ReadLine());

            if (missionChoice == 1)
            {
                EasyMission EM = new EasyMission();
                EM.MissionRequirements();
            }
            else if (missionChoice == 2)
            {
                HardMission HM = new HardMission();
                HM.MissionWeaponRequirements();
            }



marineChoice:
            Console.WriteLine("Colors Begins to play!\r\n" +
                              "Sir, I think I need another person or two to bring along with.\r\n" +
                              "1:: Bring a MachineGunner\r\n" +
                              "2:: Bring a good ole fashion 0311\r\n" +
                              "3:: Bring a scout sniper");
            int studentChoice = int.Parse(Console.ReadLine());

            switch (studentChoice)
            {
            case 1:
                MachineGunner gunner = new MachineGunner();
                gunner.WeaponAssignment();
                break;

            case 2:
                Infantry infantry2 = new Infantry();
                infantry2.WeaponAssignment();
                break;

            case 3:
                ScoutSniper sniper = new ScoutSniper();
                sniper.WeaponAssignment();
                break;

            default:
                break;
            }
            Console.WriteLine("\r\nShould we bring anyone else? Y/N");
            string restartChoice = Console.ReadLine();

            switch (restartChoice)
            {
            case "y":
                goto marineChoice;

            case "Y":
                goto marineChoice;

            case "n":
                break;

            case "N":
                break;

            default:
                break;
            }

selectTrain:
            Console.WriteLine("\r\nLets get some quick training in\r\n" +
                              "1:: Train the MachineGunner\r\n" +
                              "2:: Train the Infantryman\r\n" +
                              "3:: Train the sniper");
            int TrainChoice = int.Parse(Console.ReadLine());

            switch (TrainChoice)
            {
            case 1:
                MachineGunner gunner = new MachineGunner();
                Console.Clear();
                gunner.Train(gunner.ToString());
                break;

            case 2:
                Infantry infantry2 = new Infantry();
                Console.Clear();
                infantry2.Train(infantry2.ToString());
                break;

            case 3:
                ScoutSniper sniper = new ScoutSniper();
                Console.Clear();
                sniper.Train(sniper.ToString());
                break;

            default:
                break;
            }
            Console.WriteLine("\r\nTraining complete (Well that was useful)\r\n\r\n" +
                              "Should we train some more or do you think we are good? Y/N");
            string restartTrain = Console.ReadLine();

            switch (restartTrain)
            {
            case "y":
                goto selectTrain;

            case "Y":
                goto selectTrain;

            case "n":
                break;

            case "N":
                break;

            default:
                break;
            }

            Console.WriteLine("Well it could have been better, but I guess we're done here");
            plt.Eat();
            plt.Sleep();
            Console.ReadLine();
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            #region Instantiation
            RocketLauncher RPG        = new RocketLauncher();
            Raid           raid       = new Raid();
            Pilot          pilot1     = new Pilot("Samual");
            Jeep           wrangler   = new Jeep();
            Helicopter     littleBird = new Helicopter();
            Convoy         convoy     = new Convoy();
            AssaultRifle   AR15       = new AssaultRifle();
            Infantry       infantry1  = new Infantry("John");
            Medic          medic1     = new Medic("Sally");
            Jet            F16        = new Jet();
            #endregion

            // Story to give this program some life:
            Console.WriteLine("Welcome Soldier! Lets get you up to speed.");
            Console.WriteLine("Press Enter to continue: ");
            Console.ReadLine();
            Console.Clear();
            Console.WriteLine(" You have just arrived at FOB Del Din. Things are a little crazy up here, but for the most part we just have a two simple taskings: Defend a" +
                              " Convoy of supplies that passes through here, heading to our Soldiers up north, and Stop the enemy from Shuttling there own supplies along the borders via raids on there supply lines.");
            Console.WriteLine($"\n You have a couple good battle buddies around here who will help you out. You got the Medic, {medic1.name}. You got the Grunt (infantry guy, like yourself) " +
                              $"{infantry1.name}, and you got our world famous pilot, {pilot1.name}");
            Console.WriteLine("\n Anyways, Not to rush you to much, but we need to to pick a mission and a weapon. We move fast around here.");
            Console.WriteLine("Press enter to continue:");
            Console.ReadLine();
            Console.Clear();

            bool game  = true;
            int  input = 0;

            // Game loop. Didn't make seperate menu classes since the focus was how the inheretence worked. (A little cluttered, but it runs)
            do
            {
                Console.Clear();
                Console.WriteLine("Choose a mission: ");
                Console.WriteLine("1. Assault");
                Console.WriteLine("2. Defend");
                Console.WriteLine("3. Exit");

                input = int.Parse(Console.ReadLine());
                switch (input)
                {
                case 1:
                    raid.TaskingType();
                    AR15.ARType("AR-15");
                    AR15.ExtendedMag();
                    AR15.MuzzleBreak();
                    infantry1.Armor("Flak Jacket", "Infantry");
                    Console.WriteLine("Press enter to continue to the fight:");
                    Console.ReadLine();
                    Console.Clear();
                    AssaultStoryLine();
                    AR15.FireWeapon();
                    F16.TakeOff(pilot1.name);
                    AR15.WeaponReload();
                    AR15.WeaponJammed("SNAP");
                    Console.WriteLine("Press enter to continue:");
                    Console.ReadLine();
                    Console.Clear();
                    F16.CrashLanding(pilot1.name);
                    Console.WriteLine("As the assault continues you here over the radio a pilot had to eject from there plane.. you just hope it wasnt someone you knew..");
                    AR15.FireWeapon();
                    medic1.PatchUp("Minor bullet wounds");
                    Console.WriteLine("Everything finally ended many hours later. Made it out alive.. Who knows how that went so terribly wrong.");
                    wrangler.StartingEngine("SQQUUEEEELLLLL");
                    wrangler.Drive();
                    Console.WriteLine("You arrive back at base pretty beat up.. but youll survive.");
                    wrangler.StopEngine("VRUmmmm...");
                    medic1.Surgery();
                    Console.WriteLine("Press enter to continue");
                    Console.ReadLine();
                    break;

                case 2:
                    RPG.RocketLauncherType("RPG");
                    RPG.ExplosionSize();
                    Console.WriteLine("Press enter to continue to the fight:");
                    Console.ReadLine();
                    Console.Clear();
                    wrangler.StartingEngine("Rumm rum rumm");
                    wrangler.Drive();
                    wrangler.TireBlow(infantry1.name);
                    DefenceStoryLine();
                    RPG.FireWeapon();
                    littleBird.TakeOff(pilot1.name);
                    RPG.WeaponReload();
                    RPG.WeaponJammed("BOOM");
                    Console.WriteLine("Press enter to continue:");
                    Console.ReadLine();
                    Console.Clear();
                    littleBird.CrashLanding(pilot1.name);
                    Console.WriteLine("As the assault continues you here over the radio a pilot and his helicopter went down.. you just hope it wasnt someone you knew..");
                    RPG.FireWeapon();
                    Console.WriteLine("Everything finally ended many hours later. Made it out alive.. Who knows how that went so terribly wrong.");
                    wrangler.StartingEngine("Vroom, Vroommmm!");
                    wrangler.Drive();
                    Console.WriteLine("Press enter to continue");
                    Console.ReadLine();
                    break;

                case 3:
                    game = false;
                    break;

                default:
                    Console.WriteLine("Choose a different input: ");
                    break;
                }
            } while (game == true);
        }