Class RenderModuleConfig
java.lang.Object
io.codetoil.curved_spacetime.render.RenderModuleConfig
- All Implemented Interfaces:
ModuleConfig
The render module's settings, read from
config/render-module.config.
The render module is an API with no settings of its own yet, so the file is currently written empty. It exists so that the file and its handling are already in place when the first key is added, and so that implementations have a configuration to inherit the pattern from.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderModuleConfig(Logger logger) Creates a configuration that reports load problems to the given logger. -
Method Summary
-
Constructor Details
-
RenderModuleConfig
Creates a configuration that reports load problems to the given logger.- Parameters:
logger- the logger to warn through when the file is missing
-
-
Method Details
-
load
Reads the configuration from disk, tolerating an absent file.- Specified by:
loadin interfaceModuleConfig- Returns:
- this configuration, so that construction and loading compose
- Throws:
IOException- if the file exists but cannot be read
-
save
Writes the configuration to disk and clears the dirty flag.- Specified by:
savein interfaceModuleConfig- Throws:
IOException- if the file cannot be written
-
isDirty
public boolean isDirty()Returns whether this configuration differs from what is on disk.With no keys yet, the only cause is the file having been absent when it was loaded;
save()clears it.- Specified by:
isDirtyin interfaceModuleConfig- Returns:
trueif the file does not match this configuration and should be rewritten
-