--------------------------------------------------------
helper functions available in WOR
--------------------------------------------------------
This document has been designed to be mostly readable in
both text and HTML format.
(incomplete for now)
in Helper:
(see also the Javadoc)
/**
* Converts radians into degrees
**/
public static double rad2deg(double radians)
/**
* Converts degrees into radians
**/
public static double deg2rad(double degrees)
/**
* Angle between (0,0) and the given position, in radians.
* 0=east.
**/
public static double angleTowards(Position target)
/**
* Returns +/- (targetAngle-startAngle), depending on which
* is shorter. The angles given in parameter can have any
* value; the return value will be between -Pi and Pi.
**/
public static double shortestTurn(double startAngle, double targetAngle)
in ReadOnlyMap:
(see also the Javadoc)
/**
* Returns a Vector containing a copy of all the bullets in the map
* (of class Bullet).
* Modifying the list will not have any effect on the actual map.
*/
public Vector getBulletList()
/**
* Returns a Vector containing a copy of all the walls of the map
* (of class LinearMapObject), including the walls surrounding
* the arena.
* Modifying the list will not have any effect on the actual map.
*/
public Vector getWallList()
/**
* Returns a Vector containing a copy of all the robots of the map
* (of class RobotInfo).
* Modifying the list will not have any effect on the actual game.
*/
public Vector getRobotList()
/**
* Returns the width of the map
*/
public double getWidth()
/**
* Returns the height of the map
*/
public double getHeight()
/**
* Returns true if the two line segments intersect
*/
public boolean lineSegmentsIntersect(LinearMapObject one, LinearMapObject two)
/**
* Returns true if the distance between the line segment and the point
* is smaller than radius
*/
public boolean lineSegmentTouches(LinearMapObject line, Position pos, double radius)
/**
* Return true if the two line segment are separated by a distance
* smaller than dist
*/
public boolean lineSegmentsTouch(LinearMapObject one, LinearMapObject two, double dist)
/**
* Returns true if the given line segment goes through a wall
*/
public boolean traversesWall(LinearMapObject traj)
/**
* Returns true if the given line segment goes through a wall
* or comes to a distance closer than dist to it.
*/
public boolean traversesWall(LinearMapObject traj, double dist)
/**
* Returns true if a linear object of internalList is at a distance
* shorter than radius to the given position.
*/
public boolean touchesWall(Position pos, double radius)
/**
* Returns the number of the robot that is at a distance less than
* radius from pos, and whose number is different from except.
* If there is no such robot, returns -1.
*/
public int robotTouching(Position pos, double radius, int except)
/**
* Returns true if an object, except the robot number exceptRobot
* is at a distance shorter than radius to the given position.
*/
public boolean touchesObstacle(Position pos, double radius, int exceptRobot)
/**
* Angle between (0,0) and the given position, in radians.
* 0=east.
**/
public double angleTowards(Position target)
/**
* Returns +/- (targetAngle-startAngle), depending on which
* is shorter. The angles given in parameter can have any
* value; the return value will be between -Pi and Pi.
**/
public double shortestTurn(double startAngle, double targetAngle)
See also:
Help Javadoc
ReadOnlyMap Javadoc
Index
--
Jean-Philippe Martin