public final class Observation extends Object
Creature.look()
and Creature.observeSelf()
.Modifier and Type | Field and Description |
---|---|
int |
classId
Class ID (versus object ID) for the kind of object observed.
|
String |
className
If
type == Type.CREATURE , this is the class
name of that creature. |
Direction |
direction
If
type == Type.CREATURE , this is the
direction that creature is facing, otherwise, null. |
int |
id
If
type == Type.CREATURE , this is the ID of
that creature. |
boolean |
inFog
Fog is an experimental feature and will never appear in a
tournament map in 2012.
|
boolean |
inMud |
Point |
position
Point that was observed.
|
int |
shrineClassId
Creature.UNINITIALIZED_CLASS_ID if this is not a shrine, or
the classID for the creature owning the shrine |
long |
time
Value returned from
Creature.getGameTime() when this
observation was made. |
Type |
type
Type of object at this location.
|
Constructor and Description |
---|
Observation(int x,
int y,
long t)
Empty observation
|
Observation(Point p,
long t)
Empty observation
|
Observation(Point p,
long t,
boolean f,
boolean m,
int s) |
Observation(Point p,
String c,
int cid,
int i,
Direction dir,
long tm) |
Observation(Point p,
String c,
int cid,
int i,
Direction dir,
long tm,
boolean f,
boolean m,
int s) |
Observation(Point p,
Type t,
int classId,
long tm)
Cannot be used to make a creature observation.
|
Observation(Point p,
Type t,
int classId,
long tm,
boolean f,
boolean m,
int s)
Cannot be used to make a creature observation.
|
public Type type
public String className
type
== Type.CREATURE
, this is the class
name of that creature. Otherwise, null. This is provided only
for debugging. It is null unless security is disabled on the
simulator to prevent creatures from colluding to throw
matches.public int classId
Creature
.
This can be used to distinguish creature types, since each
creature class is assigned a unique ID at the beginning of the
trial. For example, you could use this to react differently to
FlyTraps, Apples, and unknown adversary creatures.public int id
type
== Type.CREATURE
, this is the ID of
that creature. Otherwise, 0.public Direction direction
type
== Type.CREATURE
, this is the
direction that creature is facing, otherwise, null.public Point position
public long time
Creature.getGameTime()
when this
observation was made.public boolean inFog
public boolean inMud
public int shrineClassId
Creature.UNINITIALIZED_CLASS_ID
if this is not a shrine, or
the classID for the creature owning the shrinepublic Observation(int x, int y, long t)
public Observation(Point p, long t)
public Observation(Point p, long t, boolean f, boolean m, int s)
public Observation(Point p, Type t, int classId, long tm)
tm
- Time of observationpublic Observation(Point p, Type t, int classId, long tm, boolean f, boolean m, int s)
tm
- Time of observationpublic Observation(Point p, String c, int cid, int i, Direction dir, long tm)
tm
- Time of observation