Class PolyArea

  • All Implemented Interfaces:
    Area

    public class PolyArea
    extends java.lang.Object
    implements Area
    • Constructor Detail

      • PolyArea

        public PolyArea​(WorldTile... points)
      • PolyArea

        public PolyArea​(int plane,
                        WorldTile... points)
      • PolyArea

        public PolyArea​(int[][] points)
      • PolyArea

        public PolyArea​(int plane,
                        int[][] points)
    • Method Detail

      • contains

        public boolean contains​(int x,
                                int y,
                                int plane)
        Specified by:
        contains in interface Area
      • contains2D

        public boolean contains2D​(int x,
                                  int y)
        Specified by:
        contains2D in interface Area
      • getRandomTile

        @Nullable
        public Positionable getRandomTile()
        Gets a random tile within the area.
        Specified by:
        getRandomTile in interface Area
        Returns:
        a random tile within the area or null if no tile was found
      • getMinX

        public int getMinX()
        Specified by:
        getMinX in interface Area
      • getMinY

        public int getMinY()
        Specified by:
        getMinY in interface Area
      • getMaxX

        public int getMaxX()
        Specified by:
        getMaxX in interface Area
      • getMaxY

        public int getMaxY()
        Specified by:
        getMaxY in interface Area
      • getPlane

        public int getPlane()
        Specified by:
        getPlane in interface Area