Class Zone.Helper

java.lang.Object
squidpony.squidgrid.zone.Zone.Helper
Enclosing interface:
Zone

public static final class Zone.Helper
extends Object
  • Constructor Details

  • Method Details

    • border

      public static List<Coord> border​(List<Coord> zone, List<Coord> buffer)
      An easy way to get the Coord items in a List of Coord that are at the edge of the region, using 8-way adjacency (a corner is adjacent to both orthogonal and diagonal neighbors). This is not the most efficient way to do this; If you find you need to do more complicated manipulations of regions or are calling this method often, consider using GreasedRegion, which should be significantly faster and has better support for more intricate alterations on an area of Coords.
      Parameters:
      zone - a List of Coord representing a region
      buffer - The list to fill if non null (i.e. if non-null, it is returned). If null, a fresh list will be allocated and returned.
      Returns:
      Elements in zone that are neighbors to an element not in zone.