Package net.sf.gridarta.gui.misc
Class ShiftProcessor<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.misc.ShiftProcessor<G,A,R>
-
public class ShiftProcessor<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.ObjectPerforms a "shift" operation in a map: shift all selected squares into the given direction.
-
-
Constructor Summary
Constructors Constructor Description ShiftProcessor(@NotNull MapViewSettings mapViewSettings, @NotNull MapView<G,A,R> mapView, @NotNull MapModel<G,A,R> mapModel, @NotNull InsertionModeSet<G,A,R> insertionModeSet)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanShift(@NotNull Direction dir)Checks whether shifting is possible.voidshift(@NotNull Direction dir)Shifts the map contents by one square.
-
-
-
Constructor Detail
-
ShiftProcessor
public ShiftProcessor(@NotNull @NotNull MapViewSettings mapViewSettings, @NotNull @NotNull MapView<G,A,R> mapView, @NotNull @NotNull MapModel<G,A,R> mapModel, @NotNull @NotNull InsertionModeSet<G,A,R> insertionModeSet)Creates a new instance.- Parameters:
mapViewSettings- the map view settings instancemapView- the map view to operate onmapModel- the map model to operate oninsertionModeSet- the insertion mode set to use
-
-
Method Detail
-
canShift
public boolean canShift(@NotNull @NotNull Direction dir)Checks whether shifting is possible.- Parameters:
dir- the direction to shift- Returns:
- whether shifting is possible
-
shift
public void shift(@NotNull @NotNull Direction dir)Shifts the map contents by one square. If shifting is not possible (seecanShift(Direction)) nothing is changed.- Parameters:
dir- the direction to shift
-
-