Пример #1
0
        static void Main(string[] args)

        {
            Races.Elf         race1 = new Races.Elf();
            Races.Orc         race2 = new Races.Orc();
            Races.Human       race3 = new Races.Human();
            Characters.Player test  = new Characters.Player();
            string            a     = test.DisplayText();

            Console.WriteLine(a);
            Console.ReadLine();
            Console.Clear();

            race1.setRace(test);
            a = test.DisplayText();
            Console.WriteLine(a);
            Console.ReadLine();
            Console.Clear();

            race2.setRace(test);
            a = test.DisplayText();
            Console.WriteLine(a);
            Console.ReadLine();
            Console.Clear();

            race3.setRace(test);
            a = test.DisplayText();
            Console.WriteLine(a);
            Console.ReadLine();
            Console.Clear();
        }
Пример #2
0
        private Character CreateCharacter()
        {
            bool isGood = false;

            Character newChar = new Characters.NPC();

            Console.Clear();
            Console.WriteLine("Will this character be a NPC or a Player?");
            userInput = Console.ReadLine();
            userInput = userInput.ToUpper();

            do
            {
                if (userInput == "NPC")
                {
                    newChar = new Characters.NPC();
                    isGood  = true;
                }
                else if (userInput == "PLAYER")
                {
                    newChar = new Characters.Player();
                    isGood  = true;
                }
                else
                {
                    Console.WriteLine("Please type in either NPC or Player" + "\n" + "Please hit enter to continue...");
                    Console.ReadLine();
                    Console.Clear();
                    isGood = false;
                }
            } while (isGood == false);

            return(newChar);
        }