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 enumstatic enumThe fields that can be loadedstatic classTemporary data structure for holding the field datastatic classTemporary data structure for holding obstacle data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FieldLoader.FieldDataloadField(String fieldPath, FieldLoader.CornerCutting cornerCutMode) Load a field from a filestatic FieldLoader.FieldDataloadField(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
-