Class SelectedSquareModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.panel.selectedsquare.SelectedSquareModel<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.ObjectThe model component of the selected square control.
-
-
Constructor Summary
Constructors Constructor Description SelectedSquareModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSelectedSquareListener(@NotNull SelectedSquareModelListener<G,A,R> listener)Adds aSelectedSquareModelListenerto be notified.GgetSelectedGameObject()Returns the currently selectedGameObjectwithin this list (currently selected MapSquare).@Nullable MapSquare<G,A,R>getSelectedMapSquare()Returns the currently selected map square.booleanisSelectedGameObjects(@NotNull java.lang.Iterable<G> gameObjects)booleanisSelectedMapSquares(@NotNull java.lang.Iterable<MapSquare<G,A,R>> mapSquares)voidremoveSelectedSquareListener(@NotNull SelectedSquareModelListener<G,A,R> listener)Removes aSelectedSquareModelListenerto be notified.voidsetSelectedGameObject(G gameObject)Sets the currently selectedGameObject.booleansetSelectedMapSquare(@Nullable MapSquare<G,A,R> mapSquare, G gameObject)Sets the currently selected map square.
-
-
-
Method Detail
-
getSelectedMapSquare
@Nullable public @Nullable MapSquare<G,A,R> getSelectedMapSquare()
Returns the currently selected map square.- Returns:
- the currently selected map square, or
nullif no square is selected
-
getSelectedGameObject
@Nullable public G getSelectedGameObject()
Returns the currently selectedGameObjectwithin this list (currently selected MapSquare).- Returns:
- the currently selected game object or
null
-
addSelectedSquareListener
public void addSelectedSquareListener(@NotNull @NotNull SelectedSquareModelListener<G,A,R> listener)Adds aSelectedSquareModelListenerto be notified.- Parameters:
listener- the listener to add
-
removeSelectedSquareListener
public void removeSelectedSquareListener(@NotNull @NotNull SelectedSquareModelListener<G,A,R> listener)Removes aSelectedSquareModelListenerto be notified.- Parameters:
listener- the listener to remove
-
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 squaregameObject- the selected game object, ornullto deselect it- Returns:
trueif the state has changed
-
setSelectedGameObject
public void setSelectedGameObject(@Nullable G gameObject)Sets the currently selectedGameObject.- Parameters:
gameObject- the selected game object ornull
-
-