Class ShiftProcessor<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<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.Object
    Performs a "shift" operation in a map: shift all selected squares into the given direction.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canShift​(@NotNull Direction dir)
      Checks whether shifting is possible.
      void shift​(@NotNull Direction dir)
      Shifts the map contents by one square.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 instance
        mapView - the map view to operate on
        mapModel - the map model to operate on
        insertionModeSet - 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 (see canShift(Direction)) nothing is changed.
        Parameters:
        dir - the direction to shift