Class LevelExporter

java.lang.Object
xyz.calcugames.levelz.LevelExporter

public final class LevelExporter extends Object
Represents a class that exports a LevelZ Level to a file.
  • Field Details

    • includeHeaders

      public boolean includeHeaders
      Whether to include headers in the export.
    • includeData

      public boolean includeData
      Whether to include data in the export.
    • fileExtension

      public String fileExtension
      Whether to include a section separator in the export.
    • lineSeparator

      public String lineSeparator
      The line separator to use in the export. Default is \n.
  • Method Details

    • export

      @NotNull public static @NotNull LevelExporter export(@NotNull @NotNull Level level)
      Exports the Level to a file.
      Parameters:
      level - Level to Export
      Returns:
      Level Exporter
    • writeToString

      @NotNull public @NotNull String writeToString()
      Exports the Level to a string.
      Returns:
      Level String
    • writeToFile

      public void writeToFile(@NotNull @NotNull File file)
      Writes to a file. This will create the file if it does not exist.
      Parameters:
      file - File
    • writeToPath

      public void writeToPath(@NotNull @NotNull Path file)
      Writes to a file path.
      Parameters:
      file - File Path