package jcavern;

import java.util.Observable;
import java.awt.Graphics;

/**
 * Parent class for players, monsters, and trees.
 *
 * @author	Bill Walker
 */
public abstract class Thing extends Observable implements Cloneable
{
	/** * The name of this thing. */
	private String		mName;

	/**
	 * Creates a new thing for the given world and name.
	 */
	public Thing(String aName)
	{
		mName = aName;
	}
	
	public String toString()
	{
		return getClass().getName() + "." + mName;
	}
	
	/**
	 * Returns the name of this thing.
	 */
	protected String getName()
	{
		return mName;
	}
	
	public void doTurn(World aWorld) throws JCavernInternalError
	{
	
	}
	
	public abstract Object clone();
	
	public void paint(Graphics g, int plotX, int plotY)
	{
		g.drawString(getAppearance(), plotX, plotY);
	}
	
	/**
	 * Returns the one character string that is the appearance of this thing.
	 */
	public String getAppearance()
	{
		return "?";
	}
}


@@ -56,24 +56,17 @@
 ava.awt.
-Graphics
+*
 ;%0A%0A/**%0A 
@@ -140,16 +140,33 @@
  Walker%0A
+ * @version%09$Id$%0A
  */%0Apubl
@@ -293,115 +293,401 @@
 me;%0A
-%0A%09/**%0A%09 * Creates a new thing for the given world and name.%0A%09 */%0A%09public Thing(String aName)%0A%09%7B%0A%09%09mName = a
+%09%0A%09/** * The name of the image to use for this thing. */%0A%09private String%09%09mImageName;%0A%0A%09/**%0A%09 * Creates a new thing for the given name.%0A%09 */%0A%09public Thing(String aName)%0A%09%7B%0A%09%09mName = aName;%0A%09%7D%0A%09%0A%09/**%0A%09 * Creates a new thing for the given name.%0A%09 */%0A%09public Thing(String aName, String imageName)%0A%09%7B%0A%09%09mName = aName;%0A%09%09mImageName = imageName;%0A%09%7D%0A%09%0A%09public String getImageName()%0A%09%7B%0A%09%09return mImage
 Name
@@ -1033,16 +1033,47 @@
 otY)%0A%09%7B%0A
+%09%09if (mImageName == null)%0A%09%09%7B%0A%09
 %09%09g.draw
@@ -1111,16 +1111,216 @@
 plotY);%0A
+%09%09%7D%0A%09%09else%0A%09%09%7B%0A%09%09%09Image theImage = JCavernApplet.current().getBoardImage(mImageName);%0A%09%09%0A%09%09%09g.drawImage(theImage, plotX - theImage.getWidth(null) / 2, plotY - theImage.getHeight(null) / 2, null);%0A%09%09%7D%0A
 %09%7D%0A%09%0A%09/*

put support for game board images directly into Thing