Package me.nabdev.pathfinding.utilities
Class FieldLoader
java.lang.Object
me.nabdev.pathfinding.utilities.FieldLoader
Loads a field from a JSON file
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static enum
The fields that can be loadedstatic class
Temporary data structure for holding the field datastatic class
Temporary data structure for holding obstacle data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldLoader.FieldData
loadField
(String fieldPath, FieldLoader.CornerCutting cornerCutMode) Load a field from a filestatic FieldLoader.FieldData
loadField
(FieldLoader.Field field, FieldLoader.CornerCutting cornerCutMode) Load a field from the resources folder
-
Constructor Details
-
FieldLoader
public FieldLoader()
-
-
Method Details
-
loadField
public static FieldLoader.FieldData loadField(FieldLoader.Field field, FieldLoader.CornerCutting cornerCutMode) Load a field from the resources folder- Parameters:
field
- The field to loadcornerCutMode
- The corner cutting mode to use- Returns:
- The field JSON
-
loadField
public static FieldLoader.FieldData loadField(String fieldPath, FieldLoader.CornerCutting cornerCutMode) throws FileNotFoundException Load a field from a file- Parameters:
fieldPath
- The path to the field JSON filecornerCutMode
- The corner cutting mode to use- Returns:
- The field JSON
- Throws:
FileNotFoundException
- If the file does not exist
-