Exemplo n.º 1
0
 public void setOffhand(Item<?> secondHand) {
   try {
     if (secondHand.is(Shield.class)) {
       setShield(secondHand);
       setWand(null);
     } else if (secondHand.is(WandWeapon.class)) {
       setWand(secondHand);
       setShield(null);
     } else {
       setShield(null);
       setWand(null);
     }
   } catch (NullPointerException e) {
     Logger.getLogger(Equipment.class).error("Player has wrong item");
   }
 }
Exemplo n.º 2
0
  public void setShoulderMount(Item<?> shoulderMount) {

    if (shoulderMount == null) {
      setSpecialWeapon(null);
      setMantle(null);
      setWings(null);
    } else if (shoulderMount.is(SlayerWeapon.class)) {
      setMantle(null);
      setWings(null);
      setSpecialWeapon(shoulderMount);
    } else if (shoulderMount.is(HeavyWeapon.class)) {
      setMantle(null);
      setWings(null);
      setSpecialWeapon(shoulderMount);
    } else if (shoulderMount.is(Mantle.class)) {
      setSpecialWeapon(null);
      setWings(null);
      setMantle(shoulderMount);
    } else if (shoulderMount.is(Wing.class)) {
      setSpecialWeapon(null);
      setMantle(null);
      setWings(shoulderMount);
    }
  }
Exemplo n.º 3
0
 private void setWings(Item<?> wings) {
   if (wings != null && !wings.is(Wing.class)) {
     throw new IllegalArgumentException();
   }
   this.wings = wings;
 }
Exemplo n.º 4
0
 private void setWand(Item<?> wand) {
   if (wand != null && !wand.is(WandWeapon.class)) {
     throw new IllegalArgumentException();
   }
   this.wand = wand;
 }
Exemplo n.º 5
0
 private void setSpecialWeapon(Item<?> specialWeapon) {
   if (specialWeapon != null && !specialWeapon.is(SpecialWeapon.class)) {
     throw new IllegalArgumentException();
   }
   this.specialWeapon = specialWeapon;
 }
Exemplo n.º 6
0
 private void setShield(Item<?> shield) {
   if (shield != null && !shield.is(Shield.class)) {
     throw new IllegalArgumentException();
   }
   this.shield = shield;
 }
Exemplo n.º 7
0
 public void setPants(Item<?> pants) {
   if (pants != null && !pants.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.pants = pants;
 }
Exemplo n.º 8
0
 public void setRing(Item<?> ring) {
   if (ring != null && !ring.is(Ring.class)) {
     throw new IllegalArgumentException();
   }
   this.ring = ring;
 }
Exemplo n.º 9
0
 private void setMantle(Item<?> mantle) {
   if (mantle != null && !mantle.is(Mantle.class)) {
     throw new IllegalArgumentException();
   }
   this.mantle = mantle;
 }
Exemplo n.º 10
0
 public void setNecklace(Item<?> necklace) {
   if (necklace != null && !necklace.is(Necklace.class)) {
     throw new IllegalArgumentException();
   }
   this.necklace = necklace;
 }
Exemplo n.º 11
0
 public void setHelmet(Item<?> helmet) {
   if (helmet != null && !helmet.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.helmet = helmet;
 }
Exemplo n.º 12
0
 public void setMainhand(Item<?> weapon) {
   if (weapon != null && !weapon.is(Weapon.class)) {
     throw new IllegalArgumentException();
   }
   this.weapon = weapon;
 }
Exemplo n.º 13
0
 public void setBracelet(Item<?> bracelet) {
   if (bracelet != null && !bracelet.is(Bracelet.class)) {
     throw new IllegalArgumentException();
   }
   this.bracelet = bracelet;
 }
Exemplo n.º 14
0
 public void setBoots(Item<?> boots) {
   if (boots != null && !boots.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.boots = boots;
 }
Exemplo n.º 15
0
 public void setArmor(Item<?> armor) {
   if (armor != null && !armor.is(Armor.class)) {
     throw new IllegalArgumentException();
   }
   this.armor = armor;
 }