Package net.sf.gridarta.action
Class AbstractMoveSquareAction<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.action.AbstractMoveSquareAction<G,A,R>
-
- All Implemented Interfaces:
EditorAction
- Direct Known Subclasses:
MoveSquareBottomAction,MoveSquareDownAction,MoveSquareEnvAction,MoveSquareInvAction,MoveSquareNextAction,MoveSquarePrevAction,MoveSquareTopAction,MoveSquareUpAction
public abstract class AbstractMoveSquareAction<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction
Abstract base class for actions that move the selected game object in theSelectedSquareModel.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMoveSquareAction(@NotNull SelectedSquareModel<G,A,R> selectedSquareModel, @Nullable MapManager<G,A,R> mapManager)Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleandoAction(boolean performAction)Executes the action.protected abstract booleandoAction(boolean performAction, G gameObject)Executes the action.voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.
-
-
-
Constructor Detail
-
AbstractMoveSquareAction
protected AbstractMoveSquareAction(@NotNull @NotNull SelectedSquareModel<G,A,R> selectedSquareModel, @Nullable @Nullable MapManager<G,A,R> mapManager)Creates a new instance.- Parameters:
selectedSquareModel- the selected square model to updatemapManager- the map manager to track ornull
-
-
Method Detail
-
doAction
public boolean doAction(boolean performAction)
Executes the action.- Parameters:
performAction- whether the action should be performed- Returns:
- whether the action was or can be performed
-
doAction
protected abstract boolean doAction(boolean performAction, @Nullable G gameObject)Executes the action.- Parameters:
performAction- whether the action should be performedgameObject- the current game object ornullif none is selected- Returns:
- whether the action was or can be performed
-
setAction
public void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)Description copied from interface:EditorActionSets theActioninstance for this editor action.- Specified by:
setActionin interfaceEditorAction- Parameters:
action- the action instancename- the name of the action
-
-