public class SelectedSquareModel<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
extends java.lang.Object
Constructor and Description |
---|
SelectedSquareModel() |
Modifier and Type | Method and Description |
---|---|
void |
addSelectedSquareListener(SelectedSquareModelListener<G,A,R> listener)
Adds a
SelectedSquareModelListener to be notified. |
G |
getSelectedGameObject()
Returns the currently selected
GameObject within this list
(currently selected MapSquare). |
MapSquare<G,A,R> |
getSelectedMapSquare()
Returns the currently selected map square.
|
boolean |
isSelectedGameObjects(java.lang.Iterable<G> gameObjects) |
boolean |
isSelectedMapSquares(java.lang.Iterable<MapSquare<G,A,R>> mapSquares) |
void |
removeSelectedSquareListener(SelectedSquareModelListener<G,A,R> listener)
Removes a
SelectedSquareModelListener to be notified. |
void |
setSelectedGameObject(G gameObject)
Sets the currently selected
GameObject . |
boolean |
setSelectedMapSquare(MapSquare<G,A,R> mapSquare,
G gameObject)
Sets the currently selected map square.
|
@Nullable public MapSquare<G,A,R> getSelectedMapSquare()
null
if no square
is selected@Nullable public G getSelectedGameObject()
GameObject
within this list
(currently selected MapSquare).null
public void addSelectedSquareListener(@NotNull SelectedSquareModelListener<G,A,R> listener)
SelectedSquareModelListener
to be notified.listener
- the listener to addpublic void removeSelectedSquareListener(@NotNull SelectedSquareModelListener<G,A,R> listener)
SelectedSquareModelListener
to be notified.listener
- the listener to removepublic boolean isSelectedMapSquares(@NotNull java.lang.Iterable<MapSquare<G,A,R>> mapSquares)
public boolean isSelectedGameObjects(@NotNull java.lang.Iterable<G> gameObjects)
public boolean setSelectedMapSquare(@Nullable MapSquare<G,A,R> mapSquare, @Nullable G gameObject)
mapSquare
- the selected map squaregameObject
- the selected game object, or null
to deselect
ittrue
if the state has changedpublic void setSelectedGameObject(@Nullable G gameObject)
GameObject
.gameObject
- the selected game object or null