Exemplo n.º 1
0
        public void Run()
        {
            var specalist = new Specialist();
            var nco       = new NCO();
            var warrant   = new Warrant();
            var lt        = new LT();
            var co        = new CO();
            var m4        = new M4();
            var m9        = new M9();
            var m320      = new M320();
            var glock     = new Glock();
            var hmmwv     = new HMMWV();
            var wrecker   = new Wrecker();
            var fiveton   = new FiveTon();

            Console.WriteLine("\nThis is a story of a unit going on an exercise to a field location.");
            PrepForTheField(specalist);
            PrepForTheField(nco);
            PrepForTheField(warrant);
            PrepForTheField(lt);
            PrepForTheField(co);

            PrepForTheRange(specalist, m320);
            PrepForTheRange(nco, m4);
            PrepForTheRange(warrant, glock);
            PrepForTheRange(lt, m4);
            PrepForTheRange(co, m9);

            Console.WriteLine($"\nThe Specialits are responsible for driving all vehicles to the field:");
            GoOnMission(specalist, hmmwv);
            Console.WriteLine(" ");
            GoOnMission(specalist, wrecker);
            Console.WriteLine(" ");
            GoOnMission(specalist, fiveton);
        }
Exemplo n.º 2
0
        private static void doWork()
        {
            Airplane   c17   = new Airplane();
            FireTeam   alpha = new FireTeam();
            MortarTeam bravo = new MortarTeam();
            Rifle      m4    = new Rifle();
            MachineGun m240  = new MachineGun();
            Mortar     one20 = new Mortar();

            alpha.loadVehicle();
            bravo.loadVehicle();
            c17.StartEngine("Contact");
            c17.Drive();
            c17.TakeOff();
            c17.Land();
            c17.StopEngine("Whirr");
            alpha.dismount();
            bravo.dismount();

            HMMWV a1 = new HMMWV();

            alpha.loadVehicle();
            a1.StartEngine("Brm Brm");
            a1.Accelerate();
            a1.Drive();
            alpha.receiveFire();
            alpha.returnFire();
            a1.Brake();
            alpha.dismount();
            m4.aim();
            m4.fire("Pew... Pew...");
            m4.reload();
            m240.aim();
            m240.fire("PEWPEWPEWPEWPEW");
            m240.reload();

            bravo.fireMiss();
            one20.aim();
            one20.load();
            one20.fire("Fire!!!");
        }