示例#1
0
        static void Main(string[] args)
        {
            Hmmwv      vee        = new Hmmwv("Humvee 1");
            Hmmwv      medichmmwv = new Hmmwv("Medical Humvee");
            Helicopter heli       = new Helicopter("Apache");
            Helicopter heli2      = new Helicopter("Chinhook");
            Helicopter heli3      = new Helicopter("Black Hawk");
            Medic      medic      = new Medic("SF Tom");
            Infrantry  inf1       = new Infrantry("Brian");
            Infrantry  inf2       = new Infrantry("Steve");

            Console.WriteLine("Report total number of vehicles");
            Console.WriteLine(Vehicle.numVehicles);
            Console.WriteLine("Report total number of helicopters");
            Console.WriteLine(Helicopter.numHelicopters);
            Console.WriteLine("Report total number of Hmmwvs");
            Console.WriteLine(Hmmwv.numHmmwv);
            Console.WriteLine("Report total number of Personnel");
            Console.WriteLine(Personnel.numPersonnel);

            Console.WriteLine("\nHumvee 1 move");
            vee.MoveTo(3, 3);
            vee.Stop();

            Console.WriteLine("\nApache move");
            heli.MoveTo(2, 2);
            heli.Stop();

            Console.WriteLine("\nMedic move");
            medic.MoveTo(3, 3);
            medic.Stop();

            Console.WriteLine("\nBrian Move");
            inf1.MoveTo(4, 4);
            inf1.Stop();
        }
示例#2
0
        public void Run()
        {
            Characters c          = new Characters();
            Tank       tank       = new Tank();
            Helicopter helicoper  = new Helicopter();
            MachineGun machineGun = new MachineGun();
            Bazooka    bazooka    = new Bazooka();

            c.General();
            Console.WriteLine("General:\n\nMajor, we're surrounded by the enemy!");
            Console.ReadLine();
            Console.Clear();
            c.Major();
            Console.WriteLine("Major:\n\nThat sounds great! What's the next step, sir?");
            Console.ReadLine();
            Console.Clear();
            c.General();
            Console.WriteLine("General:\n\nNot sure, I have no idea what we have and what it does, so I need a refresher!");
            Console.ReadLine();
            Console.Clear();
            c.General();
            Console.WriteLine("General:\n\nMajor, what do tanks do?");
            Console.ReadLine();
            Console.Clear();
            c.Major();
            Console.Write("Major:\n\nSir, tanks ");
            tank.RunEngine("BOOOOOOOM!");
            Console.WriteLine("Let me fire this one up:");
            tank.LoadShell();
            tank.SwivelBarrel();
            tank.Fire();
            Console.ReadLine();
            Console.Clear();
            c.General();
            Console.WriteLine("General:\n\nSmashing! Now what's a helicopter?");
            Console.ReadLine();
            Console.Clear();
            c.Major();
            Console.Write("Major:\n\nSir, helicopters ");
            helicoper.RunEngine("wop wop wop wop wop wop");
            Console.WriteLine("I'll get this one ready:");
            helicoper.StartRotor();
            helicoper.CombMustache();
            helicoper.Music();
            Console.ReadLine();
            Console.Clear();
            c.General();
            Console.WriteLine("General:\n\nWhat fun! I read an article about a machine gun, what's that?");
            Console.ReadLine();
            Console.Clear();
            c.Major();
            Console.Write("Major:\n\nSir, machine guns ");
            machineGun.FireWeapon("BRAbabapapapapaapa");
            Console.WriteLine("Here's one in action:");
            machineGun.LoadWeapon();
            machineGun.AimWeapon();
            machineGun.Fireweapon();
            Console.ReadLine();
            Console.Clear();
            c.General();
            Console.WriteLine("General:\n\nWe've got them on the ropes, give me something to blow them up!");
            Console.ReadLine();
            Console.Clear();
            c.Major();
            Console.Write("Major:\n\nSir, bazookas ");
            machineGun.FireWeapon("SHHHHOOOOOOoooooooo ... BOOOM!");
            Console.WriteLine("Firing one on the enemy:");
            machineGun.LoadWeapon();
            machineGun.AimWeapon();
            machineGun.Fireweapon();
            Console.ReadLine();
            Console.Clear();
            c.General();
            Console.WriteLine("General:\n\nVery good! I'm bored now, let's go write ourselves up for awards and drink at the O'club!");
            Console.ReadLine();
            Console.Clear();
            c.Major();
            Console.Write("Major:\n\nSounds good, Sir!");
            Console.ReadLine();
            Console.Clear();
        }