import java.awt.*; /** * Basic interface for objects in the simple simulation world. * Any object that implements this can be added to the simulation. * * CSE143 demo, Au01, Sp03, Wi05 * * @author Hal Perkins * @version 10/18/01, 4/16/03, 1/19/05 */ public interface SimThing { /** * Perform desired action for one simulation cycle. */ public void action( ); /** * Return the current horizontal location of the center of this SimThing in * simulator coordinates * @return the current x coordinate of this SimThing */ public int getX(); /** * Return the current vertical location of the center of this SimThing in * simulator coordinates * @return the current y coordinate of this SimThin */ public int getY(); /** * Draw a graphical representation of this SimThing at the given coordinates. * @param g Graphics context where the drawing should occur * @param h Horizontal screen coordinate where the center of this SimThing should appear * @param v Vertical screen coordinate where the center of this SimThing should appear */ public void render(Graphics g, int h, int v); }