Package xyz.calcugames.levelz
Class LevelExporter
java.lang.Object
xyz.calcugames.levelz.LevelExporter
Represents a class that exports a LevelZ Level to a file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionWhether to include a section separator in the export.boolean
Whether to include data in the export.boolean
Whether to include headers in the export.The line separator to use in the export. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull LevelExporter
Exports the Level to a file.void
writeToFile
(@NotNull File file) Writes to a file.void
writeToPath
(@NotNull Path file) Writes to a file path.@NotNull String
Exports the Level to a string.
-
Field Details
-
includeHeaders
public boolean includeHeadersWhether to include headers in the export. -
includeData
public boolean includeDataWhether to include data in the export. -
fileExtension
Whether to include a section separator in the export. -
lineSeparator
The line separator to use in the export. Default is\n
.
-
-
Method Details
-
export
Exports the Level to a file.- Parameters:
level
- Level to Export- Returns:
- Level Exporter
-
writeToString
Exports the Level to a string.- Returns:
- Level String
-
writeToFile
Writes to a file. This will create the file if it does not exist.- Parameters:
file
- File
-
writeToPath
Writes to a file path.- Parameters:
file
- File Path
-