Class EnterMap<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.map.mapactions.EnterMap<G,A,R>
-
public class EnterMap<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.ObjectHelper class for entering maps.
-
-
Constructor Summary
Constructors Constructor Description EnterMap(@NotNull java.awt.Component parent, @NotNull Direction @NotNull [] directionMap, @NotNull FileControl<G,A,R> fileControl, @NotNull MapViewsManager<G,A,R> mapViewsManager)Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static @NotNull java.awt.PointcalculateNewCursorLocation(@NotNull java.awt.Point oldCursorLocation, @NotNull Size2D mapSize, @NotNull Direction direction)Calculate the map cursor location for the new viewport.booleanenterExit(@NotNull MapView<G,A,R> mapView, @NotNull GameObject<G,A,R> exit, boolean allowRandomMapParameters)Opens the map an exit game object points to.booleanenterMap(@NotNull MapView<G,A,R> mapView, @NotNull MapPath mapPath, @NotNull Direction direction, @Nullable java.awt.Point destinationPoint)Enters a map wanted.booleanenterMap(@Nullable MapView<G,A,R> mapView, @NotNull MapFile mapFile, @Nullable java.awt.Point destinationPoint, @NotNull Direction direction)Enters a map.
-
-
-
Constructor Detail
-
EnterMap
public EnterMap(@NotNull @NotNull java.awt.Component parent, @NotNull @NotNull Direction @NotNull [] directionMap, @NotNull @NotNull FileControl<G,A,R> fileControl, @NotNull @NotNull MapViewsManager<G,A,R> mapViewsManager)Creates a new instance.- Parameters:
parent- the component for showing dialog boxesdirectionMap- maps relative direction to map window directionfileControl- the file controlmapViewsManager- the map views
-
-
Method Detail
-
enterMap
public boolean enterMap(@NotNull @NotNull MapView<G,A,R> mapView, @NotNull @NotNull MapPath mapPath, @NotNull @NotNull Direction direction, @Nullable @Nullable java.awt.Point destinationPoint)Enters a map wanted.- Parameters:
mapView- the map view to leavemapPath- path to map that should be loadeddirection- the direction to godestinationPoint- the desired destination point on the map (passnullif unknown, and note that the point gets modified)- Returns:
- whether the destination map has been entered
-
enterMap
public boolean enterMap(@Nullable @Nullable MapView<G,A,R> mapView, @NotNull @NotNull MapFile mapFile, @Nullable @Nullable java.awt.Point destinationPoint, @NotNull @NotNull Direction direction)Enters a map.- Parameters:
mapView- the current map view; may be closed it non-nullmapFile- the map file to enterdestinationPoint- the desired destination point on the map ornullfor defaultdirection- the direction to go- Returns:
- whether the destination map has been entered
-
enterExit
public boolean enterExit(@NotNull @NotNull MapView<G,A,R> mapView, @NotNull @NotNull GameObject<G,A,R> exit, boolean allowRandomMapParameters)Opens the map an exit game object points to.- Parameters:
mapView- the map view to leaveexit- the game objectallowRandomMapParameters- whether exit paths may point to random maps- Returns:
- whether the destination map could be opened
-
calculateNewCursorLocation
@NotNull public static @NotNull java.awt.Point calculateNewCursorLocation(@NotNull @NotNull java.awt.Point oldCursorLocation, @NotNull @NotNull Size2D mapSize, @NotNull @NotNull Direction direction)Calculate the map cursor location for the new viewport.- Parameters:
oldCursorLocation- the old cursor locationmapSize- the size of the new mapdirection- the direction to scroll- Returns:
- the new map cursor location
-
-