Package com.aldaviva.autorpg.data.entities

Examples of com.aldaviva.autorpg.data.entities.Item


        break;
       
      case RARE_ITEM:
        bulletin = new Bulletin(new Message.CharactersFoundItems(quest.getCharacters()));
        for(Character character : quest.getCharacters()){
          Item newItem = Item.findRandomByRarity(true);
          characterItemManager.offerCharacterAnItem(newItem, character);
          bulletin.add(new Message.CharacterFoundItem(character, newItem));
        }
        break;
       
View Full Code Here


  public void init(){
    LOGGER.debug("Initializing Character Item Manager.");
  }
 
  public boolean offerCharacterAnItem(Item newItem, Character character){
    Item toDiscard = itemToDiscard(character, newItem);
    if(toDiscard == null){
      addItemToCharacter(character, newItem);
      return true;
    } else if(toDiscard.equals(newItem)){
      discardNewItem(character, toDiscard);
      return false;
    } else {
      discardExistingItem(character, toDiscard);
      addItemToCharacter(character, newItem);
View Full Code Here

    List<Item> existingItems = Item.findByCharacterAndSlot(character, newItem.getSlot());
    if (existingItems.size() < newItem.getSlot().getSlotsPerCharacter()) {
      return null;
    }

    Item worstItem = newItem;

    for (int i = 0; i < existingItems.size(); i++) {
      Item existingItem = existingItems.get(i);
      worstItem = decideWorseItem(existingItem, worstItem);
    }

    return worstItem;
  }
View Full Code Here

TOP

Related Classes of com.aldaviva.autorpg.data.entities.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.