public class MapLocation extends java.lang.Object implements java.lang.Comparable<MapLocation>
Constructor and Description |
---|
MapLocation(@NotNull GameObject<?,?,?> gameObject,
boolean allowRandomMapParameters)
Creates a new instance from a
BaseObject instance. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(@NotNull MapLocation o) |
boolean |
equals(@Nullable java.lang.Object obj) |
@NotNull java.awt.Point |
getMapCoordinate()
Returns the map coordinate.
|
@NotNull MapPath |
getMapPath()
Returns the map path.
|
static @NotNull MapPath |
getMapPath(@NotNull GameObject<?,?,?> gameObject,
boolean allowRandomMapParameters)
Returns the exit map path of a
BaseObject . |
int |
hashCode() |
static @NotNull MapLocation |
newAbsoluteMapLocation(@NotNull GameObject<?,?,?> gameObject,
boolean allowRandomMapParameters)
Creates a new instance from a
BaseObject instance. |
@NotNull java.lang.String |
toString() |
public MapLocation(@NotNull @NotNull GameObject<?,?,?> 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 @NotNull MapLocation newAbsoluteMapLocation(@NotNull @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 @NotNull MapPath getMapPath()
@NotNull public @NotNull java.awt.Point getMapCoordinate()
public boolean equals(@Nullable @Nullable java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NotNull public static @NotNull MapPath getMapPath(@NotNull @NotNull GameObject<?,?,?> 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 @NotNull java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(@NotNull @NotNull MapLocation o)
compareTo
in interface java.lang.Comparable<MapLocation>