1   package interfaces;
2   
3   import java.util.*;
4   import java.awt.*;
5   
6   /**
7   * Interface class for all SimWorlds.
8   *
9   * @author Graham Ritchie
10  */
11  public interface SimWorld
12  {
13      /**
14      * Performs one update loop
15      */
16      public void tick();
17      
18      /**
19      * Returns the number of 'ticks' since this world was started
20      *
21      * @return the number of ticks as a long
22      */
23      public long getTime();
24  
25      /** Returns the light level at the specified co-ordinate.
26           * @return the brightness this will always be an int between 0 and 100
27           * @param x the x coordinate of position searched
28           * @param y the y coordinate of position searched
29           * @param z the z coordinate of position searched
30           */
31      public int getBrightness(double x, double y, double z);
32  
33      /** Checks whether there is an obstacle in the specified co-ordinate
34           * @return true or false accordingly
35           * @param x the x coordinate of position searched
36           * @param y the y coordinate of position searched
37           * @param z the z coordinate of position searched
38           */
39      public boolean hasObstacle(double x, double y, double z);
40  
41      /**
42      * Returns this SimWorld's object list
43      *
44      * @return the object list as a LinkedList
45      */
46      public LinkedList getObjectList();
47      
48      /**
49      * Adds an object to this SimWorld
50      *
51      * @param o the SimObject to be added
52      */
53      public void addObject(SimObject o);
54          
55          /** Returns the background color of this SimWorld
56           * Created by: Simon Zienkiewicz
57           * @return Colour the background colour of the current world
58           */
59      public Color getWorldColor();
60  }
61