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


  • public class SelectedSquareModel<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    The model component of the selected square control.
    • Constructor Detail

      • SelectedSquareModel

        public SelectedSquareModel()
    • Method Detail

      • getSelectedMapSquare

        @Nullable
        public @Nullable MapSquare<G,​A,​R> getSelectedMapSquare()
        Returns the currently selected map square.
        Returns:
        the currently selected map square, or null if no square is selected
      • getSelectedGameObject

        @Nullable
        public G getSelectedGameObject()
        Returns the currently selected GameObject within this list (currently selected MapSquare).
        Returns:
        the currently selected game object or null
      • isSelectedMapSquares

        public boolean isSelectedMapSquares​(@NotNull
                                            @NotNull java.lang.Iterable<MapSquare<G,​A,​R>> mapSquares)
      • isSelectedGameObjects

        public boolean isSelectedGameObjects​(@NotNull
                                             @NotNull java.lang.Iterable<G> gameObjects)
      • setSelectedMapSquare

        public boolean setSelectedMapSquare​(@Nullable
                                            @Nullable MapSquare<G,​A,​R> mapSquare,
                                            @Nullable
                                            G gameObject)
        Sets the currently selected map square.
        Parameters:
        mapSquare - the selected map square
        gameObject - the selected game object, or null to deselect it
        Returns:
        true if the state has changed
      • setSelectedGameObject

        public void setSelectedGameObject​(@Nullable
                                          G gameObject)
        Sets the currently selected GameObject.
        Parameters:
        gameObject - the selected game object or null