Esempio n. 1
0
        static void Main(string[] args)
        {
            Hokemon hokeObject01 = new Hokemon();

            Console.WriteLine("\nHokemon name is: {0}", hokeObject01.Name);

            hokeObject01.get_details();

            Hokemon hokeObject02 = new Hokemon();

            Console.WriteLine("\nHokemon name is: {0}", hokeObject02.Name);

            hokeObject02.get_details();

            // Using the about method
            hokeObject01.about();

            Battle_Arena firstArena = new Battle_Arena(); // Instantiated Battle_Arena

            firstArena.ChallengeMe(hokeObject01);
            firstArena.ChallengeAccepted(hokeObject02);
            firstArena.Battle(hokeObject01, hokeObject02);

            // Declaring members
            Hinstinct[] ChallengerArray = new Hinstinct[3];

            Random rnd        = new Random();
            bool   repeatGame = true;
            string result;

            // Creating player Hokemon
            Halor playerHokemon01 = new Halor(); // Instantiation from Halor class

            // NPC Hokemon
            for (int i = 0; i < ChallengerArray.Length; i++)
            {
                ChallengerArray[i] = new Hinstinct(); // Instatiating challenger Hokemon
            }

            while (repeatGame == true)
            {
                playerHokemon01.about();
                firstArena.ChallengeMe(playerHokemon01);
                firstArena.Battle(playerHokemon01, ChallengerArray[rnd.Next(0, ChallengerArray.Length)]);

                Console.WriteLine("\nDo you want to repeat the game? (y/n)");
                result = Console.ReadLine();
                if (result.ToLower()[0] == 'n')
                {
                    repeatGame = false;
                }
            }
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Hokeworld! ");

            Hokemon[]    ChallengerArray = new Hokemon[3];
            Battle_Arena firstArena      = new Battle_Arena(); //INSTANTIATED Battle_Arena

            Random rnd = new Random();

            bool   repeatGame;
            string result;

            Hokemon hokeObject01 = new Hokemon();

            hokeObject01.get_details();

            Console.WriteLine("\n*********\n");


            Halor haloHokemon01 = new Halor();

            haloHokemon01.get_details();
            haloHokemon01.about();

            Console.WriteLine("\n*********\n");

            Hystic hystHokemon01 = new Hystic();

            hystHokemon01.get_details();
            hystHokemon01.about();

            Console.WriteLine("\n*********\n");

            // NPC Hokemon

            for (int i = 0; i < ChallengerArray.Length; i++)
            {
                ChallengerArray[i] = new Hokemon(); // INSTATANTIATING Challenger Hokemon
            }


            Battle_Arena firstArena = new Battle_Arena();


            firstArena.Battle(hokeObject01, ChallengerArray[rnd.Next(0, ChallengerArray.Length)]);


            firstArena.ChallengeAccepted(hokeObject01, hystHokemon01); // Passing two objects into
                                                                       // the firstArena
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Hokeworld!");
            Console.WriteLine();

            // instantiate new Hokemon object (player 1)
            Hokemon hoke01 = new Hokemon();

            hoke01.get_details();
            hoke01.about();
            Console.WriteLine();

            // delays
            System.Threading.Thread.Sleep(1000);

            // instantiate new Hokemon object (player 2)
            Hokemon hoke02 = new Hokemon();

            hoke02.get_details();
            hoke02.about();
            Console.WriteLine();

            /*
             * Halor halorHoke01 = new Halor(); // inherits from Halor
             * halorHoke01.get_details();
             *
             * Hokemon hoke04 = new Hokemon(); // instantiation from Hokemon class
             *
             * // demonstrating polymorphism with about method
             * // a Hokemon instance hoke04
             * // a halor instance halorHoke01
             * hoke04.about();
             * halorHoke01.about();
             */

            // creates the object firstArena from Battle_Arena class
            Battle_Arena firstArena = new Battle_Arena();

            firstArena.Request_A_Challenger(hoke01);

            System.Threading.Thread.Sleep(3000);

            firstArena.Accept_The_Battle(hoke01, hoke02);

            firstArena.Battle(hoke01, hoke02);
        }
Esempio n. 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the world of Hokemon!\n\n");

            Hokemon HokeObject01 = new Hokemon(); // INSTANTIATING our first object

            HokeObject01.get_details();

            System.Threading.Thread.Sleep(1000); // Sleep for 1 second

            // Create a second Hokemon
            Hokemon Hoke02 = new Hokemon();

            Hoke02.get_details();

            HokeObject01.about();
            Hoke02.about();

            /*
             * Halor halorHoke01 = new Halor();
             * halorHoke01.get_details();
             * // Example of POLYMORPHISM with the about method in following objects
             * Hoke02.about();
             * halorHoke01.about();
             */

            Battle_Arena firstArena = new Battle_Arena(); // Instiating the object firstArena

            // from the Battle_Arena CLASS


            firstArena.RequestAChallenger(HokeObject01); // ARGUMENT HokeObject01
                                                         // passed into the
                                                         // firstArena object
                                                         // method Req....
            firstArena.AcceptingTheBattle(HokeObject01, Hoke02);

            firstArena.Battle(HokeObject01, Hoke02); // Starts the Battle
        }