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); }
public abstract void DamagedBy(MagicalPlayer magicalPlayer);
public override void DamagedBy(MagicalPlayer magicalPlayer) { Console.WriteLine("Attacked by magical player! "); base.Damaged(100); }