|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutils.BotInfo
Class that holds the reconi information regarding a bot at a given point in time. This information is normally gathered from scanned event's and then can be used to make decisions regarding aiming, and movement.
Constructor Summary | |
BotInfo(robocode.ScannedRobotEvent e,
robocode.Robot observer)
Bot info constructor for ScannedRobotEvent |
|
BotInfo(java.lang.String name,
double width,
double height,
double heading,
double x,
double y,
double life,
double speed,
long time)
Default constructor for BotInfo |
Method Summary | |
boolean |
equals(java.lang.Object arg0)
|
double |
getBearing(robocode.Robot observer)
|
double |
getDistance(robocode.Robot observer)
Calculates distance from observer |
double |
getEnergy()
Returns bot energy |
double |
getHeading()
|
long |
getLastUpdate()
Returns last update time |
java.lang.String |
getName()
Returns bot name |
double |
getSpeed()
Returns bot speed |
double |
getX()
Returns bot x position |
double |
getY()
Returns bot y position |
double |
predictBearing(long when,
robocode.Robot observer)
Predicts bearing in the future |
double |
predictX(long when)
Predict bot position in some time in the future |
double |
predictY(long when)
Predict bot position in some time in the future |
java.lang.String |
toString()
|
void |
update(double heading,
double x,
double y,
double life,
double speed,
long time)
Updates BotInfo parameters |
void |
update(robocode.ScannedRobotEvent e,
robocode.Robot observer)
Updates BotInfo parameters basing on a ScannedRobotEvent |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public BotInfo(java.lang.String name, double width, double height, double heading, double x, double y, double life, double speed, long time)
name
- Robot namewidth
- Battlefield widthheight
- Battlefield heightheading
- Robot headingx
- Robot X positiony
- Robot Y positionlife
- Robot remaining energyspeed
- Robot current speedtime
- Current timepublic BotInfo(robocode.ScannedRobotEvent e, robocode.Robot observer)
e
- ScannedRobotEventobserver
- Observer robotMethod Detail |
public void update(double heading, double x, double y, double life, double speed, long time)
heading
- Robot headingx
- Robot X positiony
- Robot Y positionlife
- Robot remaining energyspeed
- Robot current speedtime
- Current timepublic void update(robocode.ScannedRobotEvent e, robocode.Robot observer)
e
- ScannedRobotEventobserver
- Observer robotpublic double predictX(long when)
when
- Time to be predicted
public double predictY(long when)
when
- Time to be predicted
public double getDistance(robocode.Robot observer)
observer
- Observer robot
public double getHeading()
public double getBearing(robocode.Robot observer)
public double predictBearing(long when, robocode.Robot observer)
when
- Time to be predictedobserver
- Robot observer
public long getLastUpdate()
public double getEnergy()
public java.lang.String getName()
public double getSpeed()
public double getX()
public double getY()
public java.lang.String toString()
public boolean equals(java.lang.Object arg0)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |