예제 #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            Missions  m1 = new Mission1();
            Personnel p1 = new Person1("P1");
            Personnel p2 = new Person2("P2");
            Personnel p3 = new Person3("P3");
            Personnel p4 = new Personnel();

            Personnel[] team = { p1, p2, p3, p4 };
            Weapons     w1   = new Weapon1();
            Vehicles    v1   = new Vehicles();

            m1.Excute();
            m1.Detail(team, w1, v1);
        }
예제 #2
0
        private void DoPersonnelStuff(Personnel personnel)
        {
            if (personnel is Medical asMedical)
            {
                asMedical.MedicalCamp();
            }
            else
            {
                personnel.Fire();
            }


            var totalfight = personnel.Fights();

            personnel.Rest();
            personnel.Reload();

            totalfight += personnel.Fights();

            Console.WriteLine($"Total hours of fight {totalfight}\n");
        }
        static void UnitBuild()
        {
            Console.WriteLine("This is your new unit.");


            Platoon myplatoon = new Platoon();

            myplatoon.Company("A");


            Personnel myPersonnel = new Personnel();

            myPersonnel.PersonnelNumber();

            Vehicles myVehicles = new Vehicles();

            myVehicles.VehiclesNumber();

            Weapons myWeapons = new Weapons();

            myWeapons.WeaponsNumber();
        }
예제 #4
0
        static void Components()
        {
            Console.WriteLine("\nEquipment");
            Equipment myEquipment = new Equipment();

            Console.WriteLine("Weapons");
            Weapons myWeapons = new Weapons();

            myWeapons.ShotSound("Pow Pow");
            myWeapons.m16();
            myWeapons.m1014();
            myWeapons.m240();
            Console.Read();

            Console.WriteLine("Vehicles");
            Vehicles myVehicles = new Vehicles();

            myVehicles.StartSound("Whirrrr");
            myVehicles.JLTV();
            myVehicles.MTVR();
            myVehicles.HMMWV();
            myVehicles.HEMTT();
            Console.Read();

            Console.WriteLine("Personnel");
            Personnel myPersonnel = new Personnel();

            myPersonnel.Pvt();
            myPersonnel.Lcpl();
            myPersonnel.Cpl();
            myPersonnel.Sgt();
            myPersonnel.SSgt();
            myPersonnel.GySgt();
            myPersonnel.MSgt();
            myPersonnel.ISgt();
            myPersonnel.MGysgt();
            myPersonnel.SgtMaj();
            Console.Read();
        }
예제 #5
0
        static void Main(string[] args)
        {
            Ranger           powerRanger   = new Ranger("Power Ranger");
            _82ndParatrooper troop         = new _82ndParatrooper("Airborne Ace");
            Personnel        wannabeRanger = new Personnel("GI Joe");
            List <Personnel> Soldiers      = new List <Personnel> {
                powerRanger, troop, wannabeRanger
            };
            List <IAirborne> Paragliders = new List <IAirborne> {
                powerRanger, troop
            };

            SuperCoolMotorCycle superCycle = new SuperCoolMotorCycle("GhostRider", 1);
            WheeledVehicle      humvee     = new WheeledVehicle("HMMWV", 5);
            Helicopter          chinook    = new Helicopter("CH-47", 8);

            DisplayColorComment("For each ranger, paratrooper, and Soldier, demonstrate eating a meal, traveling for an hour, and mounting/dismounting a vehicle.");
            Console.WriteLine();
            foreach (var solider in Soldiers)
            {
                solider.EatMRE();
                solider.PrintCurrentPosition();
                Console.WriteLine($"{solider.name} moved for an hour.");
                solider.Move(10, 10);
                solider.PrintCurrentPosition();
                superCycle.LoadTroops(solider);
                superCycle.UnloadTroops(solider);
                humvee.LoadTroops(solider);
                Console.WriteLine();
            }

            var manifest = humvee.GetManifest();

            Console.Write($"List of passangers in {humvee.name}: ");

            foreach (var passenger in manifest)
            {
                Console.Write(passenger.name + " || ");
            }

            Console.WriteLine();
            DisplayColorComment("Simulating a Soldier traveling in a vehicle");  // Would work better as a method.
            wannabeRanger.PrintCurrentPosition();
            humvee.LoadTroops(wannabeRanger);
            humvee.Move(wannabeRanger, 5, 10);
            wannabeRanger.PrintCurrentPosition();

            DisplayColorComment("Only rangers and paratroopers can perform an airborne operation.");
            DisplayColorComment("Paratroopers get bored and lose HP during the preparation of an airborne operation.");
            foreach (var paraglider in Paragliders)
            {
                paraglider.AirborneOperation();
            }

            DisplayColorComment("Only rangers and paratroopers can ride a super cool motorcycle.");
            foreach (var soldier in Soldiers)
            {
                Console.Write(soldier.name);
                superCycle.Wheelie(soldier);
            }

            DisplayColorComment("Soldiers can travel in a helicopter. Only Airborne qualified personnel can perform a jump");
            foreach (var soldier in Soldiers)
            {
                chinook.LoadTroops(soldier);
                chinook.SkyDive(soldier);
            }
        }
예제 #6
0
        static void Main(string[] args)
        {
            //personnel Data
            Personnel     personnel     = new Personnel();
            Corporate     corporate     = new Corporate();
            Managment     managment     = new Managment();
            LowerEnlisted lowerEnlisted = new LowerEnlisted();


            Console.ForegroundColor = ConsoleColor.DarkCyan;
            Console.WriteLine("Airborne Ops Data\n");

            Thread.Sleep(1000);
            personnel.NumberOfPersonnel(150);
            corporate.NumberOfPersonnel(15);
            managment.NumberOfPersonnel(45);
            lowerEnlisted.NumberOfPersonnel(90);

            Console.ReadKey();
            Console.Clear();


            //Transportation data
            Transportation transportation = new Transportation();
            Aircraft       aircraft       = new Aircraft();
            Vehicles       vehicles       = new Vehicles();

            Thread.Sleep(1000);
            transportation.NumberOfTrans(12);
            aircraft.NumberOfTrans(4);
            aircraft.NumberOfAirCrafts(2, "C-130");
            aircraft.NumberOfAirCrafts(2, "C-17");

            Thread.Sleep(1000);

            vehicles.NumberOfTrans(8);
            vehicles.NumberOfVehicles(3, "HMMVVs");
            vehicles.NumberOfVehicles(5, "LMTVs");

            Console.ReadKey();
            Console.Clear();

            //parachute data
            Parachutes          parachutes   = new Parachutes();
            PersonnelParachutes peopleChutes = new PersonnelParachutes();
            Cargo cargo = new Cargo();

            parachutes.TotalNumberOfParachutes(6000);

            peopleChutes.TotalNumberOfParachutes(5500);
            peopleChutes.PeopleParachutes(1200, "T-10s");
            peopleChutes.PeopleParachutes(1150, "T-11M");
            peopleChutes.PeopleParachutes(3150, "T-11R");

            Thread.Sleep(1000);

            cargo.TotalNumberOfParachutes(500);
            cargo.HeavyRigParachutes(125, "G-11B");
            cargo.HeavyRigParachutes(135, "G-12");
            cargo.HeavyRigParachutes(240, "G-14");

            Console.ReadKey();
        }
예제 #7
0
        public void Manage()
        {
            Console.WriteLine("*************** Base Class Weapon ****************");
            Console.WriteLine("\n");
            //For SmallArms
            Console.WriteLine("*************** Child Class Small Arms ****************");
            Console.WriteLine("\n");
            weaponObj = new SmallArms();
            weaponObj.setWeaponID(100);
            weaponObj.setWeaponName("AK47");
            weaponObj.setWeaponWeight(3.47f);
            weaponObj.setWeaponUsage("For short Ranges");
            weaponObj.setWeaponRange(0.200f);
            weaponObj.setWeaponEffectiveness("Very effective in short ranges");
            ((SmallArms)weaponObj).setAutomatic(false);
            ((SmallArms)weaponObj).setBullets(390);
            Console.WriteLine(((SmallArms)weaponObj).ToString());
            Console.WriteLine("\n");

            //For LightWeapons
            Console.WriteLine("*************** Child Class Light Weapons ****************");
            Console.WriteLine("\n");
            weaponObj = new LightWeapons(101, "Heavy Machine Gun", 38.0f, "For medium Ranges", "Very effective for medium ranges", 5.0f, true, 1000);
            Console.WriteLine(((LightWeapons)weaponObj).ToString());
            Console.WriteLine("\n");

            //For Explosives
            Console.WriteLine("*************** Child Class Explosives ****************");
            Console.WriteLine("\n");
            weaponObj = new Explosives();
            weaponObj.setWeaponID(102);
            weaponObj.setWeaponName("Missile ");
            weaponObj.setWeaponWeight(1300.0f);
            weaponObj.setWeaponUsage("For long Ranges");
            weaponObj.setWeaponRange(2000.0f);
            weaponObj.setWeaponEffectiveness("Very effective for long ranges");
            ((Explosives)weaponObj).setDestructive(true);
            ((Explosives)weaponObj).setSize(500.0f);
            Console.WriteLine(((Explosives)weaponObj).ToString());
            Console.WriteLine("\n");

            Console.WriteLine("*************** Base Class Vehicle ****************");
            Console.WriteLine("\n");
            //For Coordinates
            Coordinates coord = new Coordinates();

            coord.setPositionX(1);
            coord.setPositionY(2);
            coord.setPositionZ(3);

            //For Aircraft
            Console.WriteLine("*************** Child Class Aircraft ****************");
            Console.WriteLine("\n");
            vehicleObj = new Aircraft();
            ((Aircraft)vehicleObj).setAltitude(7000.67f);

            //For Fighter
            Console.WriteLine("*************** Sub Child Class Fighter ****************");
            Console.WriteLine("\n");
            vehicleObj = new Fighter();
            vehicleObj.setHeading(180.0f);
            vehicleObj.setLatitude(coord);
            vehicleObj.setLongitude(coord);
            vehicleObj.setVehicleID(200);
            vehicleObj.setVehicleName("Fighter");
            ((Fighter)vehicleObj).setSpeed(7200.0f);
            Console.WriteLine(((Fighter)vehicleObj).ToString());
            Console.WriteLine("\n");


            //For Bomber
            Console.WriteLine("*************** Sub Child Class Bomber ****************");
            Console.WriteLine("\n");
            vehicleObj = new Bomber();
            vehicleObj.setHeading(150.6f);
            vehicleObj.setLatitude(coord);
            vehicleObj.setLongitude(coord);
            vehicleObj.setVehicleID(201);
            vehicleObj.setVehicleName("Bomber");
            ((Bomber)vehicleObj).setWeapon(true);
            Console.WriteLine(((Bomber)vehicleObj).ToString());
            Console.WriteLine("\n");

            //For Ship
            Console.WriteLine("*************** Child Class Ship ****************");
            Console.WriteLine("\n");
            vehicleObj = new Ship();
            ((Ship)vehicleObj).setDepth(300.0f);

            //For Cruiser
            Console.WriteLine("*************** Sub Child Class Cruiser ****************");
            Console.WriteLine("\n");
            vehicleObj = new Cruiser();
            vehicleObj.setHeading(130.5f);
            vehicleObj.setLatitude(coord);
            vehicleObj.setLongitude(coord);
            vehicleObj.setVehicleID(200);
            vehicleObj.setVehicleName("Cruiser");
            ((Cruiser)vehicleObj).setCrew(15);
            Console.WriteLine(((Cruiser)vehicleObj).ToString());
            Console.WriteLine("\n");


            //For Submarine
            Console.WriteLine("*************** Sub Child Class Submarine ****************");
            Console.WriteLine("\n");
            vehicleObj = new Submarine();
            vehicleObj.setHeading(89.6f);
            vehicleObj.setLatitude(coord);
            vehicleObj.setLongitude(coord);
            vehicleObj.setVehicleID(201);
            vehicleObj.setVehicleName("Submarine");
            ((Submarine)vehicleObj).setType("Ballistic missile");
            Console.WriteLine(((Submarine)vehicleObj).ToString());
            Console.WriteLine("\n");

            Console.WriteLine("*************** Base Class Personnel ****************");
            Console.WriteLine("\n");
            //For Uniform
            Console.WriteLine("*************** Child Class Uniform ****************");
            Console.WriteLine("\n");
            personnelObj = new Uniform();
            personnelObj.setAlive(true);
            personnelObj.setFatigue(45);
            personnelObj.setGender("male");
            personnelObj.setHunger(50);
            personnelObj.setPerformance(70);
            personnelObj.setPersonID(300);
            personnelObj.setPersonName("john");
            personnelObj.setRank("commander");
            personnelObj.setStress(60);
            ((Uniform)personnelObj).setTenure(25);
            Console.WriteLine(((Uniform)personnelObj).ToString());
            Console.WriteLine("\n");

            //For NonUniform
            Console.WriteLine("*************** Child Class Non Uniform ****************");
            Console.WriteLine("\n");
            personnelObj = new NonUniform();
            personnelObj.setAlive(true);
            personnelObj.setFatigue(45);
            personnelObj.setGender("male");
            personnelObj.setHunger(50);
            personnelObj.setPerformance(70);
            personnelObj.setPersonID(301);
            personnelObj.setPersonName("eric");
            personnelObj.setRank("Driver");
            personnelObj.setStress(60);
            ((NonUniform)personnelObj).setPersonsCapacity(50);
            Console.WriteLine(((NonUniform)personnelObj).ToString());
            Console.WriteLine("\n");

            Console.WriteLine("*************** Base Class Mission ****************");
            Console.WriteLine("\n");
            //For Team
            Console.WriteLine("*************** Child Class Team ****************");
            Console.WriteLine("\n");
            missionObj = new Team();
            missionObj.setCategory("Alpha");
            missionObj.setDuration(4.5f);
            missionObj.setMissionName("Mission Bravo");
            missionObj.setMissionID(400);
            ((Team)missionObj).setLeaderName("Andrew");
            ((Team)missionObj).setTeamMembers(5);
            ((Team)missionObj).setTeamSignature("hawk");
            Console.WriteLine(((Team)missionObj).ToString());
            Console.WriteLine("\n");
        }