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

  • All Implemented Interfaces:
    MapView<G,​A,​R>
    Direct Known Subclasses:
    DefaultMapView

    public abstract class AbstractMapView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    implements MapView<G,​A,​R>
    Abstract base class for MapView implementations.
    • Constructor Detail

      • AbstractMapView

        protected AbstractMapView​(@NotNull
                                  @NotNull MapModel<G,​A,​R> mapModel,
                                  @NotNull
                                  @NotNull MapGrid mapGrid,
                                  @NotNull
                                  @NotNull MapCursor<G,​A,​R> mapCursor)
        Creates a new instance.
        Parameters:
        mapModel - the map model of this map view
        mapGrid - the map grid of this map view
        mapCursor - the map cursor of this map view
    • Method Detail

      • getSelectedGameObjects

        @NotNull
        public @NotNull java.util.List<G> getSelectedGameObjects()
        Description copied from interface: MapView
        Return all selected game objects. If nothing is selected, return all game objects from the entire map.
        Specified by:
        getSelectedGameObjects in interface MapView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
        Returns:
        the selected game objects
      • getSelectedGameObject

        @Nullable
        public G getSelectedGameObject()
        Description copied from interface: MapView
        Return one selected game object. If more than one game object is selected, return a random one. If nothing is selected, return a random game object from the entire map.
        Specified by:
        getSelectedGameObject in interface MapView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
        Returns:
        one random selected game object, or null if no game object is selected
      • setCursorLocation

        public void setCursorLocation​(@NotNull
                                      @NotNull java.awt.Point point)
        Description copied from interface: MapView
        Sets the cursor location. If the map location is not within map bounds the cursor is set to the nearest valid location.
        Specified by:
        setCursorLocation in interface MapView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
        Parameters:
        point - the new location will be modified to the actually set cursor location
      • centerMapView

        public void centerMapView​(@NotNull
                                  @NotNull java.awt.Point centerSquare)
        Description copied from interface: MapView
        Centers the map view on a map square.
        Specified by:
        centerMapView in interface MapView<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
        Parameters:
        centerSquare - the map square