public class MapLocation extends java.lang.Object implements java.lang.Comparable<MapLocation>
Constructor and Description |
---|
MapLocation(BaseObject<?,?,?,?> gameObject,
boolean allowRandomMapParameters)
Creates a new instance from a
BaseObject instance. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MapLocation o) |
boolean |
equals(java.lang.Object obj) |
java.awt.Point |
getMapCoordinate()
Returns the map coordinate.
|
MapPath |
getMapPath()
Returns the map path.
|
static MapPath |
getMapPath(BaseObject<?,?,?,?> gameObject,
boolean allowRandomMapParameters)
Returns the exit map path of a
BaseObject . |
int |
hashCode() |
static MapLocation |
newAbsoluteMapLocation(GameObject<?,?,?> gameObject,
boolean allowRandomMapParameters)
Creates a new instance from a
BaseObject instance. |
java.lang.String |
toString() |
public MapLocation(@NotNull BaseObject<?,?,?,?> gameObject, boolean allowRandomMapParameters) throws NoExitPathException
BaseObject
instance.gameObject
- the game objectallowRandomMapParameters
- whether random map parameters should be
consideredNoExitPathException
- if the game object is not a valid exit@NotNull public static MapLocation newAbsoluteMapLocation(@NotNull GameObject<?,?,?> gameObject, boolean allowRandomMapParameters) throws NoExitPathException
BaseObject
instance. The new MapLocation
instance includes an absolute map path.gameObject
- the game objectallowRandomMapParameters
- whether random map parameters should be
consideredNoExitPathException
- if the game object is not a valid exit@NotNull public MapPath getMapPath()
@NotNull public java.awt.Point getMapCoordinate()
public boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NotNull public static MapPath getMapPath(@NotNull BaseObject<?,?,?,?> gameObject, boolean allowRandomMapParameters) throws NoExitPathException
BaseObject
.gameObject
- the game objectallowRandomMapParameters
- whether random maps should be consideredNoExitPathException
- if the game object is not a valid exit@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(@NotNull MapLocation o)
compareTo
in interface java.lang.Comparable<MapLocation>