public class Connection
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
boolean |
selected |
Constructor and Description |
---|
Connection(MapObj startMapObj,
MapObj endMapObj) |
Connection(MapObj startMapObj,
MapObj endMapObj,
Line colour)
A connection between two adjacent MapObjs in the Map.
|
Modifier and Type | Method and Description |
---|---|
Line |
getColour() |
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 |
isLocked() |
boolean |
isReverseOf(Connection connection) |
void |
setColour(Line lineColour)
sets the colour of the connection to a new value
|
void |
toggleLocked() |
java.lang.String |
toJSON()
Generates a JSON String
|
java.lang.String |
toString() |
public Connection(MapObj startMapObj, MapObj endMapObj, Line colour)
startMapObj
- Where the connection beginsendMapObj
- Where the connection endscolour
- The colour of the connectionpublic float getLength()
public com.badlogic.gdx.math.Vector2 getVector()
public MapObj getStartMapObj()
public MapObj getDestination()
public com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getRouteBlips()
public Line getColour()
public boolean isLocked()
public void toggleLocked()
public boolean isReverseOf(Connection connection)
connection
- to be comparedpublic void setColour(Line lineColour)
lineColour
- to be setpublic java.lang.String toJSON()
public java.lang.String toString()
toString
in class java.lang.Object