import java.util.*; /** Every Thing must implement this interface. @author Ben Dugan, Hal Perkins CSE 142 Summer 2001, Homework 6 */ public interface Thing { /** A Thing will receive this message once per simulation cycle, during the movement phase of the simulation. The thing should change its position, if it wishes to do so. */ public void move(); /** A Thing will receive this message once per simulation cycle, during the spawning phase of the simulation. The Thing may add any "children" to the given ArrayList. */ public void spawn(ArrayList c); /** A Thing will receive this message once per simulation cycle, during the graphics window update phase. The Thing should display itself. */ public void display(GWindow g); /** A Thing must answer with its X coordinate in the world. */ public int getX(); /** A Thing must answer with its Y coordinate in the world. */ public int getY(); /** A Thing must answer with a string which describes what kind of thing it is, for example "Algae". */ public String kindOfThing(); /** A Thing must answer whether or not it consumes the given kind of thing. For instance, an OilBlob would answer true if presented "Algae" or "Fish". */ public boolean consumes(String kindOfThing); /** This method will be called when a Thing consumes the given kind of thing. */ public void consume(String kindOfThing); }