rle.core.board
Class Creature

java.lang.Object
  extended by rle.core.vm.PlugInBase
      extended by rle.core.board.Thing
          extended by rle.core.board.Creature
All Implemented Interfaces:
java.lang.Cloneable, RuntimeDataListener, PlugIn
Direct Known Subclasses:
Monster, Player

public class Creature
extends Thing

A creature. Superclass for Monsters, NPCs, Players. Note that a Creature can be configured by information from the Variant Manager because it implements PlugIn.


Field Summary
protected  CreatureAi ai
           
protected  int energy
           
protected  java.util.HashMap<java.lang.String,ItemContainer> itemContainers
           
 
Fields inherited from class rle.core.board.Thing
attributes, data, enclosed, enclosing, locator, temporaryCharms
 
Fields inherited from class rle.core.vm.PlugInBase
config, context, parameters
 
Constructor Summary
Creature()
           
 
Method Summary
 void addItemContainer(java.lang.String key, ItemContainer container)
          Add a location for storing items.
 CreatureAi getAi()
          Returns the AI Object controlling this creature.
 int getEnergy()
           
 ItemContainer getItemContainer(java.lang.String key)
          Finds an item storage location.
 java.util.Set<java.lang.String> itemContainerKeys()
          The set of keys for the available item locations.
 void removeItemContainer(java.lang.String key)
          Remove an item storage location.
 void setAi(CreatureAi ai)
           
 void setEnergy(int energy)
           
 
Methods inherited from class rle.core.board.Thing
addThingListener, attributeKeySet, attributeMap, checkAttribute, clone, dataChange, enclosingObject, fireLocationChange, getAttribute, getId, getRuntimeData, getSize, getTemporaryCharm, locator, putAttribute, putTemporaryCharm, removeAttribute, removeTemporaryCharm, removeThingListener, setConfig, setEnclosingObject, setRuntimeData, setSize, temporaryCharmKeySet, toString
 
Methods inherited from class rle.core.vm.PlugInBase
config, getContext, getParameters, paramMap, setParameters
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ai

protected CreatureAi ai

energy

protected int energy

itemContainers

protected java.util.HashMap<java.lang.String,ItemContainer> itemContainers
Constructor Detail

Creature

public Creature()
Method Detail

getEnergy

public int getEnergy()

setEnergy

public void setEnergy(int energy)

getAi

public CreatureAi getAi()
Returns the AI Object controlling this creature. This may be null, especially for the (non-borg) player. Note, however, it is possible to assign an AI to the player, allowing for "auto-play" features to be implemented. It is also possible to implement features like running and repeating commands via an AI.


setAi

public void setAi(CreatureAi ai)

addItemContainer

public void addItemContainer(java.lang.String key,
                             ItemContainer container)
Add a location for storing items.


removeItemContainer

public void removeItemContainer(java.lang.String key)
Remove an item storage location.


getItemContainer

public ItemContainer getItemContainer(java.lang.String key)
Finds an item storage location. If not found, throws IllegalArgumentException.


itemContainerKeys

public java.util.Set<java.lang.String> itemContainerKeys()
The set of keys for the available item locations.