Пример #1
0
        static void Main(string[] args)
        {
            SuperHero superHero = new SuperHero("SuperHero Dude", 20);

            superHero.Powers.Add(new Power("Teleportation", 50));
            superHero.Powers.Add(new Power("Phasing", 40));
            superHero.Powers.Add(new Power("Invisibility", 30));
            Console.WriteLine(superHero.ToString());
            Console.WriteLine("Karma: " + superHero.Karma);
            Console.WriteLine();

            SuperVillain superVillain = new SuperVillain("SuperVillain Dude", 20);

            superVillain.AddPower("Shadow Casting", 50);
            superVillain.AddPower("Mind Control", 40);
            superVillain.AddPower("Combat Senses", 30);
            Console.WriteLine(superVillain.ToString());
            Console.WriteLine("Malice: " + superVillain.Malice);
            Console.WriteLine();

            AntiHero batman = new AntiHero("Batman", 20, 20);

            batman.AddPower("Super Intelligence", 50);
            Console.WriteLine(batman.ToString());
            Console.WriteLine("Karma: " + batman.Karma);
            Console.WriteLine("Malice: " + batman.Malice);
            Console.WriteLine();

            if (superVillain.GetPower("Shadow Casting") < superVillain.GetPower("Mind Control"))
            {
                Console.WriteLine("Shadow Casting is more powerful than Mind Control");
            }
        }
        static void Main(string[] args)
        {
            SuperHuman superHuman = new SuperHuman("Super Dude");

            superHuman.AddPower("Spider Climbing", 50);
            superHuman.AddPower("Webcasting", 40);
            Console.WriteLine(superHuman.ToString());
            Console.WriteLine("Karma: " + superHero.Karma);
            Console.WriteLine();

            SuperVillain superVillain = new SuperVillain("SuperVillain Dude", 20);

            superVillain.AddPower("Shadow Casting", 50);
            superVillain.AddPower("Mind Control", 40);
            superVillain.AddPower("Combat Senses", 30);
            Console.WriteLine(superVillain.ToString());
            Console.WriteLine("Malice: " + superVillain.Malice);
        }
Пример #3
0
        static void Main(string[] args)
        {
            SuperHero superHero = new SuperHero("Super Dude", 20);

            superHero.AddPower("Spider Climbing", 50);
            superHero.AddPower("Webcasting", 40);
            Console.WriteLine(superHero.ToString());

            SuperVillain superVillain = new SuperVillain("Super Dude LV2", 20);

            superVillain.AddPower("Spider Climbing LV2", 50);
            superVillain.AddPower("Webcasting LV2", 40);
            Console.WriteLine(superVillain.ToString());

            if (superHero is SuperHero)
            {
                Console.WriteLine("super dude is definitely a superhero!");
            }
            else
            {
                Console.WriteLine("super dude is not a hero!");
            }
        }
Пример #4
0
        static void Main(string[] args)
        {
            SuperHero superHero = new SuperHero("SuperHero Dude", 20);

            superHero.Powers.Add(new Power("Teleportation", 50));
            superHero.Powers.Add(new Power("Phasing", 40));
            superHero.Powers.Add(new Power("Invisibility", 30));
            Console.WriteLine(superHero.ToString());
            Console.WriteLine("Karma: " + superHero.Karma);
            Console.WriteLine();

            SuperVillain superVillain = new SuperVillain("SuperVillain Dude", 20);

            superVillain.AddPower("Shadow Casting", 50);
            superVillain.AddPower("Mind Control", 40);
            superVillain.AddPower("Combat Senses", 30);
            Console.WriteLine(superVillain.ToString());
            Console.WriteLine("Malice: " + superVillain.Malice);

            if (superHero is SuperHero)
            {
                Console.WriteLine("Super Dude is definitely a SuperHero");
            }
        }