Exemplo n.º 1
0
 public static void Main()
 {
     // create a Weapon object
     Weapon myWeapon = new Weapon();
     //create a Warrior (Client) object
     Warrior myWarrior = new Warrior(myWeapon);
     myWarrior.Attack("lame programmers");
 }
Exemplo n.º 2
0
 /**  Warrior constructor that takes Weapon obj
  * @param myWeapon is responsible for setting the weapon obj
  */
 public Warrior(Weapon myWeapon)
 {
     this.myWeapon = myWeapon;
 }