public interface BoardElement extends org.json.JSONString, Colorable, UserData
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COLOR_TOKEN
The key for the color field for JSON implementations.
|
static java.lang.String |
DESTINATION_TOKEN
The key for the destination field for JSON implementations.
|
static java.lang.String |
LENGTH_TOKEN
The key for the length field for JSON implementations.
|
static java.lang.String |
LOCATION_TOKEN
The key for the location field for JSON implementations.
|
static java.lang.String |
NAME_TOKEN
The key for the name field for JSON implementations.
|
static java.lang.String |
X_TOKEN
The key for the x field for JSON implementations.
|
static java.lang.String |
Y_TOKEN
The key for the y field for JSON implementations.
|
Modifier and Type | Method and Description |
---|---|
Board |
getBoard()
Return the board to which this BoardElement.
|
java.lang.String |
getMappedName()
The Name this Object has when drawn on the board
|
int |
getRelativeX()
Return the x coordinate of this Object's string drawing relative to the object.
|
int |
getRelativeY()
Return the y coordinate of this Object's string drawing relative to the object.
|
boolean |
isTruckHere(Truck t)
Return true iff t is currently at/on this BoardElement.
|
int |
trucksHere()
Return the number of trucks here.
|
void |
updateGUILocation(int x,
int y)
Update the location of this on the gui (change it to (x, y)).
|
getColor, isColorSignificant
getUserData, setUserData
static final java.lang.String X_TOKEN
static final java.lang.String Y_TOKEN
static final java.lang.String NAME_TOKEN
static final java.lang.String COLOR_TOKEN
static final java.lang.String LOCATION_TOKEN
static final java.lang.String DESTINATION_TOKEN
static final java.lang.String LENGTH_TOKEN
java.lang.String getMappedName()
int getRelativeX()
int getRelativeY()
boolean isTruckHere(Truck t)
int trucksHere()
void updateGUILocation(int x, int y)
Board getBoard()