Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            IWeaponBehavior axeBehavior   = new AxeBehavior();
            IWeaponBehavior bowBehavior   = new BowAndArrowBehavior();
            IWeaponBehavior knifeBehavior = new KnifeBehavior();
            IWeaponBehavior swordBehavior = new SwordBehavior();

            Character kingCharacter = new King(swordBehavior);

            kingCharacter.Fight();
            kingCharacter.SetWeapon(knifeBehavior);
            kingCharacter.Fight();

            Character queenCharacter = new Queen(knifeBehavior);

            queenCharacter.Fight();

            Character knightCharacter = new Knight(swordBehavior);

            knightCharacter.Fight();

            Character trollCharacter = new Troll(axeBehavior);

            trollCharacter.Fight();
        }
Ejemplo n.º 2
0
 public Knight()
 {
     iWB = new BowAndArrowBehavior();
 }
Ejemplo n.º 3
0
 public Queen()
 {
     weaponBehavior = new BowAndArrowBehavior();
 }
Ejemplo n.º 4
0
 public Knight()
 {
     Icharacter = new Fight();
     Iweapon    = new BowAndArrowBehavior();
 }
Ejemplo n.º 5
0
 public Knight()
 {
     weapon = new BowAndArrowBehavior();
 }
Ejemplo n.º 6
0
 public King()
 {
     _weaponBehavior = new BowAndArrowBehavior();
 }
Ejemplo n.º 7
0
 public Troll()
 {
     weapon = new BowAndArrowBehavior();
 }
 public Queen()
 {
     Weapon = new BowAndArrowBehavior();
 }