Class FillUtils


  • public class FillUtils
    extends java.lang.Object
    Utility class implementing fill operations on map instances.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
      void
      fill​(@NotNull MapModel<G,​A,​R> mapModel, @NotNull java.util.Collection<MapSquare<G,​A,​R>> selection, @NotNull InsertionMode insertionMode, @NotNull java.util.List<? extends BaseObject<G,​A,​R,​?>> gameObjects, int density, boolean noAdjacent)
      Fills a set of squares in a map.
      static <G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
      void
      floodFill​(@NotNull MapModel<G,​A,​R> mapModel, @NotNull java.awt.Point start, @NotNull java.util.List<? extends BaseObject<G,​A,​R,​?>> gameObjects, @NotNull InsertionModeSet<G,​A,​R> insertionModeSet)
      Flood-fill the the map, starting at the cursor position.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • fill

        public static <G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>> void fill​(@NotNull
                                                                                                                                                        @NotNull MapModel<G,​A,​R> mapModel,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull java.util.Collection<MapSquare<G,​A,​R>> selection,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull InsertionMode insertionMode,
                                                                                                                                                        @NotNull
                                                                                                                                                        @NotNull java.util.List<? extends BaseObject<G,​A,​R,​?>> gameObjects,
                                                                                                                                                        int density,
                                                                                                                                                        boolean noAdjacent)
        Fills a set of squares in a map.
        Parameters:
        mapModel - the map to fill
        selection - the squares to fill
        insertionMode - the insertion mode to use
        gameObjects - the game objects to fill with
        density - the fill density in percent; -1 to disable
        noAdjacent - whether squares are skipped if an adjacent squares is not free
      • floodFill

        public static <G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>> void floodFill​(@NotNull
                                                                                                                                                             @NotNull MapModel<G,​A,​R> mapModel,
                                                                                                                                                             @NotNull
                                                                                                                                                             @NotNull java.awt.Point start,
                                                                                                                                                             @NotNull
                                                                                                                                                             @NotNull java.util.List<? extends BaseObject<G,​A,​R,​?>> gameObjects,
                                                                                                                                                             @NotNull
                                                                                                                                                             @NotNull InsertionModeSet<G,​A,​R> insertionModeSet)
        Flood-fill the the map, starting at the cursor position.
        Parameters:
        mapModel - the map to fill
        start - the starting location
        gameObjects - the game objects to fill with
        insertionModeSet - the insertion mode set to use