/**
 * A thing can be either a game item or a game character. 
 * It is in a container (a room or a character). 
 */
public abstract class Thing extends Container{
  
  private Container container;
  /**
   * Get the type of this thing.
   *
   * @return the thing type
   */
  public abstract ThingType getThingType();
  
  /**
   * Get this things's container.
   *
   * @return this thing's container
   */
  public Container getContainer(){
    return container;
  }
  
  /**
   * Set this thing's container. 
   *
   * @param container this thing's new container.
   */
  public void setContainer(Container container){
    this.container = container;
  }
  
  /**
   * Remove this thing from its current container, if any. 
   *
   */
  public void removeSelf() {
    Container c = getContainer();
    if (c != null)
      c.removeThing(this);
  }
}