Class Cheese

java.lang.Object
com.technicjelle.BMUtils.Cheese

public class Cheese extends Object
A Shape with possibly some holes.
  • Constructor Details

    • Cheese

      public Cheese(Shape shape)
      Creates a new Cheese with no holes.
      Parameters:
      shape - The outer shape of the cheese.
    • Cheese

      public Cheese(Shape shape, Shape... holes)
      Creates a new Cheese with holes.
      Parameters:
      shape - The outer shape of the cheese.
      holes - Any holes in the cheese.
    • Cheese

      public Cheese(Shape shape, Collection<Shape> holes)
      Creates a new Cheese with holes.
      Parameters:
      shape - The outer shape of the cheese.
      holes - Any holes in the cheese.
  • Method Details

    • getShape

      public Shape getShape()
      Returns:
      The outer shape of the cheese.
    • getHoles

      public Collection<Shape> getHoles()
      Returns:
      Any holes in the cheese.
    • createPlatterFromChunks

      public static Collection<Cheese> createPlatterFromChunks(Vector2i... chunks)
      Creates BlueMap Shapes with potentially some holes, from a collection of chunks.
      Designed to be looped over and fed into a BlueMap ShapeMarker or ExtrudeMarker
      Parameters:
      chunks - The chunks to create the cheese from.
      Returns:
      A collection of Cheese objects, each representing a single connected area.
    • createSingleFromChunks

      public static Cheese createSingleFromChunks(Vector2i... chunks)
      Creates a single BlueMap Shape with potentially some holes, from a collection of chunks.
      Designed to be fed directly into a BlueMap ShapeMarker or ExtrudeMarker.

      WARNING:

      This method assumes that all chunks are connected!
      If you're not absolutely 100% sure that your chunks will always be connected, use createPlatterFromChunks(Vector2i...) instead.
      If multiple disconnected areas are found, only the first one will be returned.
      Parameters:
      chunks - The chunks to create the cheese from.
      Returns:
      A single Cheese object representing a single connected area.
    • createPlatterFromCells

      public static Collection<Cheese> createPlatterFromCells(Vector2d cellSize, Vector2i... cells)
      Creates BlueMap Shapes with potentially some holes, from a collection of custom-sized cells.
      Designed to be looped over and fed into a BlueMap ShapeMarker or ExtrudeMarker
      Parameters:
      cellSize - The size of a single cell.
      cells - The cells to create the cheese from.
      Returns:
      A collection of Cheese objects, each representing a single connected area.
    • createSingleFromCells

      public static Cheese createSingleFromCells(Vector2d cellSize, Vector2i... cells)
      Creates a single BlueMap Shape with potentially some holes, from a collection of custom-sized cells.
      Designed to be fed directly into a BlueMap ShapeMarker or ExtrudeMarker.

      WARNING:

      This method assumes that all cells are connected!
      If you're not absolutely 100% sure that your cells will always be connected, use createPlatterFromCells(Vector2d, Vector2i...) instead.
      If multiple disconnected areas are found, only the first one will be returned.
      Parameters:
      cellSize - The size of a single cell.
      cells - The cells to create the cheese from.
      Returns:
      A single Cheese object representing a single connected area.