Пример #1
0
        static void Main(string[] args)
        {
            var barbarian = new Barbarian();

            barbarian.Weapon = new Axe();

            var knight = new Knight();

            knight.Weapon = new Sword();

            barbarian.Fight();
            knight.Fight();
            Console.WriteLine();

            barbarian.Weapon = new Sword();
            knight.Weapon    = new Knife();

            barbarian.Fight();
            knight.Fight();

            Console.ReadLine();
        }
Пример #2
0
 public void Setup()
 {
     barbarian = new Barbarian(new MeleeStrategy());
 }