Пример #1
0
        static void Main(string[] args)
        {
            BasePlayer physicalPlayer = new PhysicalPlayer();
            BasePlayer magicalPlayer  = new MagicalPlayer();

            BaseMonster flea = new Flea();
            BaseMonster bat  = new Bat();

            physicalPlayer.Attack(flea);
            physicalPlayer.Attack(bat);

            Console.WriteLine();

            magicalPlayer.Attack(flea);
            magicalPlayer.Attack(bat);
        }
Пример #2
0
 public abstract void DamagedBy(MagicalPlayer magicalPlayer);
Пример #3
0
 public override void DamagedBy(MagicalPlayer magicalPlayer)
 {
     Console.WriteLine("Attacked by magical player! ");
     base.Damaged(100);
 }