JSON Configuration File is a plugin for Godot that aims to aid reading user input via a JSON file. It uses three types of classes for this purpose:
- JSONConfigFile: The main class of this plugin. This class would read the user input file, detecting its potential errors. This class also returns the dictionary obtained. It works by adding properties of the desired JSON structure via code.
- JSONProperty: The class that defines what restrictions a given property has. This class itself does not apply any test to the user input, but every other property extends from this one. Here it is the list with the twelve types of properties based on this class, alongside the input they expect:
- JSONPropertyBool: Booleans.
- JSONPropertyNumber: Real numbers.
- JSONPropertyInteger: Integers.
- JSONPropertyPercentage: Real numbers, in the range [0, 1].
- JSONPropertyString: Strings.
- JSONPropertyEnum: Strings from an array of possible values.
- JSONPropertyArray: Arrays.
- JSONPropertyColor: Arrays with 3 to 4 elements. They represent a color in RGB or RGBA, with each value being an integer in the range [0, 255].
- JSONPropertyObject: Dictionaries.
- JSONPropertyFile: Strings representing a path to a file.
- JSONPropertyJSONConfigFile: Strings representing a path to a JSON configuration file.
- JSONPropertyImage: Strings representing a path to an image file.
- JSONConfigProcessor: The abstract class from which any custom process must extend. The functionality of this class is a bit advanced, but basically, it serves as a way to create functions to process the user input before or after the property tests.