public class EnterMap<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
| Constructor and Description |
|---|
EnterMap(java.awt.Component parent,
Direction[] directionMap,
FileControl<G,A,R> fileControl,
MapViewsManager<G,A,R> mapViewsManager)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
static java.awt.Point |
calculateNewCursorLocation(java.awt.Point oldCursorLocation,
Size2D mapSize,
Direction direction)
Calculate the map cursor location for the new viewport.
|
boolean |
enterExit(MapView<G,A,R> mapView,
GameObject<G,A,R> exit,
boolean allowRandomMapParameters)
Opens the map an exit game object points to.
|
boolean |
enterMap(MapView<G,A,R> mapView,
MapFile mapFile,
java.awt.Point destinationPoint,
Direction direction)
Enters a map.
|
boolean |
enterMap(MapView<G,A,R> mapView,
MapPath mapPath,
Direction direction,
java.awt.Point destinationPoint)
Enters a map wanted.
|
void |
showLocation(MapView<G,A,R> mapView,
java.awt.Point point)
Scrolls a map view to make a give tile visible.
|
public EnterMap(@NotNull
java.awt.Component parent,
@NotNull
Direction[] directionMap,
@NotNull
FileControl<G,A,R> fileControl,
@NotNull
MapViewsManager<G,A,R> mapViewsManager)
parent - the component for showing dialog boxesdirectionMap - maps relative direction to map window directionfileControl - the file controlmapViewsManager - the map viewspublic boolean enterMap(@NotNull
MapView<G,A,R> mapView,
@NotNull
MapPath mapPath,
@NotNull
Direction direction,
@Nullable
java.awt.Point destinationPoint)
mapView - the map view to leavemapPath - path to map that should be loadeddirection - the direction to godestinationPoint - the desired destination point on the map (pass
null if unknown, and note that the point gets modified)public boolean enterMap(@Nullable
MapView<G,A,R> mapView,
@NotNull
MapFile mapFile,
@Nullable
java.awt.Point destinationPoint,
@NotNull
Direction direction)
mapView - the current map view; may be closed it non-nullmapFile - the map file to enterdestinationPoint - the desired destination point on the map or
null for defaultdirection - the direction to gopublic void showLocation(@NotNull
MapView<G,A,R> mapView,
@NotNull
java.awt.Point point)
mapView - the map viewpoint - the squarepublic boolean enterExit(@NotNull
MapView<G,A,R> mapView,
@NotNull
GameObject<G,A,R> exit,
boolean allowRandomMapParameters)
mapView - the map view to leaveexit - the game objectallowRandomMapParameters - whether exit paths may point to random
maps@NotNull
public static java.awt.Point calculateNewCursorLocation(@NotNull
java.awt.Point oldCursorLocation,
@NotNull
Size2D mapSize,
@NotNull
Direction direction)
oldCursorLocation - the old cursor locationmapSize - the size of the new mapdirection - the direction to scroll