Package cz.cuni.mff.abacs.burglar.logics.objects.items

Examples of cz.cuni.mff.abacs.burglar.logics.objects.items.Item


  }
 
 
  @Override
  public boolean pickUp(Inventory inventory, Item item) {
    Item result = inventory.removeItem(item.getId());
    if(result != null)
      this.addItem(item);
    this.examine((Position)inventory);
   
    this._knowledge.forgetItemPosition(item);
View Full Code Here


   * @return success of the operation
   */
  private boolean takeClothes(Agent agent, Agent subjectAgent) {
    int id = subjectAgent.getItemIdOfType(BaseInterface.Type.UNIFORM);
   
    Item item;
    if(id != -1)
      item = subjectAgent.removeItem(id);
    else{
      item = new Uniform(this.getNextID(), this);
      this.addItem(item);
View Full Code Here

  }
 
 
  @Override
  public Item removeItem(int id) {
    Item result = super.removeItem(id);
    if(result != null && result.isTypeOf(Type.UNIFORM))
      this._isDisguised = false;
    return result;
  }
View Full Code Here

        node.getNodeName().equals(STR_TREASURE)
      ){
        // get the element
        Element treasureElement = (Element)node;
        // create the object
        Item item = XMLLoader.getTreasure(treasureElement, map);
        ret.add(item);
      }
    }
    return ret;
  }
View Full Code Here

  private static Item getTreasure(Element treasureElement, DataMap map) {
    // get the attributes:       
    int id = XMLBase.getIntAttrOrZero(treasureElement, STR_ID);
   
    // create the object:
    Item item = new Treasure(id, map);
   
    return item;
  }
View Full Code Here

        node.getNodeName().equals(STR_KEY)
      ){
        // get the element
        Element keyElement = (Element)node;
        // create the object
        Item key = XMLLoader.getKey(keyElement, map);
        // add it to list
        ret.add(key);
      }
    }
    return ret;
View Full Code Here

  private static Item getKey(Element keyElement, DataMap map) {
    // get the attributes:       
    int id = XMLBase.getIntAttrOrZero(keyElement, STR_ID);
   
    // create the object:
    Item key = new Key(id, map);
   
    return key;
  }
View Full Code Here

TOP

Related Classes of cz.cuni.mff.abacs.burglar.logics.objects.items.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.