com.TeamHEC.LocomotionCommotion.Map
Class Connection

java.lang.Object
  extended by 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.
 
Method Summary
 MapObj getDestination()
           
 float getLength()
           
 com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getRouteBlips()
           
 MapObj getStartMapObj()
           
 com.badlogic.gdx.math.Vector2 getVector()
           
 boolean isReverseOf(Connection connection)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 begins
endMapObj - Where the connection ends
Method Detail

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