Esempio n. 1
0
 private boolean hasItem(final String itemId) {
   boolean hasItem = false;
   for (final Item item : getEquipment()) {
     hasItem |= itemId.equals(item.getId());
   }
   return hasItem;
 }
Esempio n. 2
0
 @Override
 public boolean equals(final Object obj) {
   if (obj instanceof String) {
     return id.equals(obj);
   } else if (obj instanceof Item) {
     final Item other = (Item) obj;
     return other.getId().equals(id);
   }
   return false;
 }
Esempio n. 3
0
 @Override
 public Item clone() {
   Item cloned;
   try {
     cloned = (Item) super.clone();
     cloned.equipInfo = equipInfo.clone();
   } catch (final CloneNotSupportedException exception) {
     throw new CloneFailedException(exception);
   }
   return cloned;
 }
  /**
   * Bean for storing data to display on the character page for Fighting Fantasy ruleset.
   *
   * @param character the character
   * @param handler the {@link SorCharacter} to use for obtaining the characters' properties
   */
  public SorCharacterPageData(final SorCharacter character, final FfCharacterHandler handler) {
    super(character, handler);
    usedLibra = character.isUsedLibra();

    final Iterator<Item> itemIterator = getItems().iterator();
    while (itemIterator.hasNext()) {
      final Item item = itemIterator.next();
      if (item.getItemType() == ItemType.curseSickness) {
        curses.add(item);
        itemIterator.remove();
      }
    }
    commandActive =
        character.getCommandView() != null
            && character.getCommandView().getViewName().startsWith("sorFight");
    wizard = character.isWizard();
    vikKnown = handler.getItemHandler().hasItem(character, "4012");
  }