Пример #1
0
        public static void Main()
        {
            Elf         elf         = new Elf("Pesho", 10);
            Wizard      wizard      = new Wizard("Petq", 10);
            Knight      knight      = new Knight("Gosho", 3);
            MuseElf     museElf     = new MuseElf("Pesho child", 2);
            DarkWizard  darkWizard  = new DarkWizard("Petq dark", 1);
            SoulMaster  soulMaster  = new SoulMaster("Ivan", 33);
            BladeKnight bladeKnight = new BladeKnight("Joro", 67);

            var heros = new List <Hero>();

            heros.Add(elf);
            heros.Add(wizard);
            heros.Add(knight);
            heros.Add(museElf);
            heros.Add(darkWizard);
            heros.Add(soulMaster);
            heros.Add(bladeKnight);

            foreach (var item in heros)
            {
                Console.WriteLine(item);
            }
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Hero gosho = new BladeKnight("Gosho", 12);
            Hero pesho = new DarkWizard("Pesho", 12);

            Console.WriteLine(gosho);
            Console.WriteLine(pesho);
        }
Пример #3
0
        public static void Main(string[] args)
        {
            var elf = new Elf("Elf", 100);

            Console.WriteLine(elf);

            var darkWizard = new DarkWizard("DarkWiz2", 239);

            Console.WriteLine(darkWizard);
        }
Пример #4
0
        public static object CreateAHero(string type, string username, int level)
        {
            object hero;

            switch (type.ToLower())
            {
            case "elf":
                hero = new Elf(username, level);
                break;

            case "museelf":
                hero = new MuseElf(username, level);
                break;

            case "wizard":
                hero = new Wizard(username, level);
                break;

            case "darkwizard":
                hero = new DarkWizard(username, level);
                break;

            case "soulmaster":
                hero = new SoulMaster(username, level);
                break;

            case "knight":
                hero = new Knight(username, level);
                break;

            case "darkknight":
                hero = new DarkKnight(username, level);
                break;

            case "bladeknight":
                hero = new BladeKnight(username, level);
                break;

            default:
                throw new InvalidOperationException("The type of the hero that you are trying to enter does not exist.");
            }

            return(hero);
        }
Пример #5
0
        static void Main(string[] args)
        {
            Elf         elf         = new Elf("Elf", 22);
            Knight      knight      = new Knight("Knight", 20);
            Wizard      wizard      = new Wizard("Wizard", 21);
            MuseElf     museElf     = new MuseElf("MuseElf", 23);
            DarkWizard  darkWizard  = new DarkWizard("darkWizard", 24);
            DarkKnight  darkKnight  = new DarkKnight("darkKnight", 25);
            SoulMaster  soulMaster  = new SoulMaster("soulMaster", 26);
            BladeKnight bladeKnight = new BladeKnight("bladeKnight", 27);


            Console.WriteLine(elf);
            Console.WriteLine(knight);
            Console.WriteLine(wizard);
            Console.WriteLine(museElf);
            Console.WriteLine(darkWizard);
            Console.WriteLine(darkKnight);
            Console.WriteLine(soulMaster);
            Console.WriteLine(bladeKnight);
        }
Пример #6
0
        static void Main(string[] args)
        {
            Wizard wizard = new DarkWizard("Manfred", 7);

            Console.WriteLine(wizard);
        }
Пример #7
0
 static void Main(string[] args)
 {
     Wizard asd = new DarkWizard("asd", 11);
 }