Exemple #1
0
        static void Main(string[] args)
        {
            Character character = new Knight();

            character.Fight();
            character.SetWeapon(new BowAndArrowBehavior());
            character.Fight();

            character = new King();
            character.Fight();
            character.SetWeapon(new KnifeBehavior());
            character.Fight();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Character knight = new Knight();
            Character troll  = new Troll();

            knight.Fight();
            troll.Fight();

            Console.ReadKey();
        }