Class MapViewManager<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

  • All Implemented Interfaces:
    java.lang.Iterable<MapView<G,​A,​R>>

    public class MapViewManager<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    implements java.lang.Iterable<MapView<G,​A,​R>>
    Maintains all map views.
    • Constructor Detail

      • MapViewManager

        public MapViewManager()
    • Method Detail

      • setActiveMapView

        public void setActiveMapView​(@NotNull
                                     @NotNull MapView<G,​A,​R> mapView)
        Sets the active map view. The map view will be moved to the front.
        Parameters:
        mapView - the map view to activate
      • removeMapView

        public void removeMapView​(@NotNull
                                  @NotNull MapView<G,​A,​R> mapView)
        Removes a map view. Activates another map view if the active map view is removed.
        Parameters:
        mapView - the map view to remove
      • addMapView

        public void addMapView​(@NotNull
                               @NotNull MapView<G,​A,​R> mapView)
        Adds a map view. The map view becomes the active map view.
        Parameters:
        mapView - the map view to add
      • deactivateMapView

        public void deactivateMapView​(@NotNull
                                      @NotNull MapView<G,​A,​R> mapView)
        Deactivates a map view.
        Parameters:
        mapView - the map view to deactivate
      • activateMapView

        public void activateMapView​(@NotNull
                                    @NotNull MapView<G,​A,​R> mapView)
        Activates a map view.
        Parameters:
        mapView - the map view to activate
      • iterator

        @NotNull
        public @NotNull java.util.Iterator<MapView<G,​A,​R>> iterator()
        Returns all opened map views.
        Specified by:
        iterator in interface java.lang.Iterable<G extends GameObject<G,​A,​R>>
        Returns:
        all opened map views; the result cannot be modified
      • addMapViewManagerListener

        public void addMapViewManagerListener​(@NotNull
                                              @NotNull MapViewManagerListener<G,​A,​R> listener)
        Adds a listener to be notified.
        Parameters:
        listener - the listener to add
      • removeMapViewManagerListener

        public void removeMapViewManagerListener​(@NotNull
                                                 @NotNull MapViewManagerListener<G,​A,​R> listener)
        Removes a listener to be notified.
        Parameters:
        listener - the listener to remove
      • getActiveMapView

        @Nullable
        public @Nullable MapView<G,​A,​R> getActiveMapView()
        Returns the active top map view we are working with.
        Returns:
        the active top map view we are working with or null if no map view is open
      • doPrevWindow

        public boolean doPrevWindow​(boolean performAction)
        Executes the "prev window" action.
        Parameters:
        performAction - whether the action should be performed
        Returns:
        whether the action was or can be performed
      • doNextWindow

        public boolean doNextWindow​(boolean performAction)
        Executes the "next window" action.
        Parameters:
        performAction - whether the action should be performed
        Returns:
        whether the action was or can be performed