public class RadarResults extends java.util.ArrayList<ObjectStatus>
Each radar sweep will return a collection of ObjectStatus
objects representing the objects in range of the radar sweep. If a level
1, 2, or 4 sweep was performed, these ObjectStatus
es
will not be fully populated. Attempting to access data that was not determined
by the radar sweep will result in a zero-equivalent value.
RadarCommand
,
Serialized FormConstructor and Description |
---|
RadarResults() |
Modifier and Type | Method and Description |
---|---|
ObjectStatus |
getById(int id)
Gets the details read by this radar sweep for a particular object whose
ID is previously known.
|
ObjectStatus |
getByPosition(Point pos)
Gets the details read by this radar sweep for a particular object whose
location is previously known.
|
java.util.List<ObjectStatus> |
getByType(java.lang.String type)
Gets the details read by this radar sweep for all objects of the given
type.
|
int |
getNumObjects()
Gets the number of objects detected by this radar sweep.
|
public int getNumObjects()
Note: for a level 3 sweep, this will be either 0 or 1.
public ObjectStatus getById(int id)
id
- the ID of the object to lookuppublic ObjectStatus getByPosition(Point pos)
pos
- the position of the object to lookuppublic java.util.List<ObjectStatus> getByType(java.lang.String type)
Could be Ship, Planet, BlackHole, Star, Nebula, Asteroid, Torpedo, Bauble, Bubble, or Outpost.
type
- the type of object for which to return results