public class Path
extends java.lang.Object
| Constructor and Description |
|---|
Path()
Creates a path with zero speed.
|
Path(double speed)
Creates a path with constant speed
|
Path(Path path)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addWaypoint(Coord wp)
Adds a new waypoint to the end of the path.
|
void |
addWaypoint(Coord wp,
double speed)
Adds a new waypoint with a speed towards that waypoint
|
java.util.List<Coord> |
getCoords()
Returns a reference to the coordinates of this path
|
Coord |
getNextWaypoint()
Returns the next waypoint on this path
|
double |
getSpeed()
Returns the speed towards the next waypoint (asked with
getNextWaypoint(). |
java.util.List<java.lang.Double> |
getSpeeds() |
boolean |
hasNext()
Returns true if the path has more waypoints, false if not
|
void |
setSpeed(double speed)
Sets a constant speed for the whole path.
|
java.lang.String |
toString()
Returns a string presentation of the path's coordinates
|
public Path()
public Path(Path path)
path - The path to create the copy frompublic Path(double speed)
speed - The speed on the pathpublic void setSpeed(double speed)
public java.util.List<Coord> getCoords()
public void addWaypoint(Coord wp)
wp - The waypoint to addpublic void addWaypoint(Coord wp, double speed)
wp - The waypointspeed - The speed towards that waypointpublic Coord getNextWaypoint()
public boolean hasNext()
public double getSpeed()
getNextWaypoint().public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List<java.lang.Double> getSpeeds()