com.TeamHEC.LocomotionCommotion.Map
Class Connection
java.lang.Object
com.TeamHEC.LocomotionCommotion.Map.Connection
public class Connection
- extends java.lang.Object
- Author:
- Matthew Taylor
Constructor Summary |
Connection(MapObj startMapObj,
MapObj endMapObj)
A connection between two adjacent MapObjs in the Map. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Connection
public Connection(MapObj startMapObj,
MapObj endMapObj)
- A connection between two adjacent MapObjs in the Map.
Defubes the distance between them (length0 and direction (vector)
- Parameters:
startMapObj
- Where the connection beginsendMapObj
- Where the connection ends
getLength
public float getLength()
- Returns:
- the length between the start and end of a connection
getVector
public com.badlogic.gdx.math.Vector2 getVector()
- Returns:
- A normalised vector of the direction needed to reach the end of the connection
getStartMapObj
public MapObj getStartMapObj()
- Returns:
- the start of a connection
getDestination
public MapObj getDestination()
- Returns:
- the destination of a connection
getRouteBlips
public com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getRouteBlips()
- Returns:
- An Array of routeblips used when creating a route
isReverseOf
public boolean isReverseOf(Connection connection)
- Parameters:
connection
- to be compared
- Returns:
- true if two connections are the same but reversed