Class Observation

java.lang.Object
  extended by Observation

public final class Observation
extends java.lang.Object

Returned by Creature.look


Field Summary
 java.lang.String className
          If type == CREATURE, this is the classname of that creature.
 Direction direction
          If type == CREATURE, this is the direction that creature is facing.
 int id
          If type == CREATURE, this is the ID of that creature.
 java.awt.Point position
          Point that was observed.
 int time
          Value returned from Creature.getTime() when this observation was made.
 Type type
          Type of object at this location.
 
Constructor Summary
Observation(int x, int y, int t)
           
Observation(java.awt.Point p, int t)
           
Observation(java.awt.Point p, java.lang.String c, int i, Direction dir, int tm)
           
Observation(java.awt.Point p, Type t, int tm)
          Cannot be used to make a creature observation.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

public Type type
Type of object at this location.


className

public java.lang.String className
If type == CREATURE, this is the classname of that creature. Otherwise, null.


id

public int id
If type == CREATURE, this is the ID of that creature. Otherwise, 0.


direction

public Direction direction
If type == CREATURE, this is the direction that creature is facing.


position

public java.awt.Point position
Point that was observed.


time

public int time
Value returned from Creature.getTime() when this observation was made.

Constructor Detail

Observation

public Observation(int x,
                   int y,
                   int t)

Observation

public Observation(java.awt.Point p,
                   int t)

Observation

public Observation(java.awt.Point p,
                   Type t,
                   int tm)
Cannot be used to make a creature observation.

Parameters:
tm - Time of observation

Observation

public Observation(java.awt.Point p,
                   java.lang.String c,
                   int i,
                   Direction dir,
                   int tm)
Parameters:
tm - Time of observation
Method Detail

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object