public class Observation extends java.lang.Object implements java.lang.Comparable<Observation>
Modifier and Type | Field and Description |
---|---|
int |
category
Category of this observation (static, resource, npc, etc.).
|
int |
itype
Type of sprite of this observation.
|
int |
obsID
unique ID for this observation
|
Vector2d |
position
Position of the observation.
|
Vector2d |
reference
Reference to the position used for comparing this
observation with others.
|
double |
sqDist
Distance from this observation to the reference.
|
Constructor and Description |
---|
Observation() |
Observation(int itype,
int id,
Vector2d pos,
Vector2d posReference,
int category)
New observation.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Observation o)
Compares this observation to others, using distances to the reference position.
|
boolean |
equals(java.lang.Object other)
Compares two Observations to check if they are equal.
|
java.lang.String |
toString() |
void |
update(int itype,
int id,
Vector2d pos,
Vector2d posReference,
int category)
Updates this observation
|
public int category
public int itype
public int obsID
public Vector2d position
public Vector2d reference
public double sqDist
public Observation()
public Observation(int itype, int id, Vector2d pos, Vector2d posReference, int category)
itype
- type of the sprite of this observationid
- ID of the observation.pos
- position of the sprite.posReference
- reference to compare this position to others.category
- category of this observation (NPC, static, resource, etc.)public void update(int itype, int id, Vector2d pos, Vector2d posReference, int category)
itype
- type of the sprite of this observationid
- ID of the observation.pos
- position of the sprite.posReference
- reference to compare this position to others.category
- category of this observation (NPC, static, resource, etc.)public int compareTo(Observation o)
compareTo
in interface java.lang.Comparable<Observation>
o
- other observation.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
other
- the other observation.public java.lang.String toString()
toString
in class java.lang.Object