Class Config

java.lang.Object
dev.prozilla.pine.core.state.config.Config

public class Config extends Object
Manages configuration of the application.
  • Field Details Link icon

    • FPS Link icon

      public static final ConfigKey<Integer> FPS
    • ENABLE_DEPTH_RECALCULATION Link icon

      public static final ConfigKey<Boolean> ENABLE_DEPTH_RECALCULATION
    • DEFAULT_FONT_PATH Link icon

      public static final ConfigKey<String> DEFAULT_FONT_PATH
    • fps Link icon

      public final ConfigOption<Integer> fps
      Target frames per second. When set to 0, fps is uncapped. Defaults to 120.
    • enableDepthRecalculation Link icon

      public final ConfigOption<Boolean> enableDepthRecalculation
      Determines whether depth values will be recalculated when new entities are added to the world. Defaults to true.
    • defaultFontPath Link icon

      public final ConfigOption<String> defaultFontPath
    • rendering Link icon

      public final RenderConfig rendering
      Options related to rendering.
    • logging Link icon

      public final LogConfig logging
      Options related to logging.
    • window Link icon

      public final WindowConfig window
      Options related to the application window.
  • Constructor Details Link icon

  • Method Details Link icon

    • addOption Link icon

      public <T> void addOption(ConfigKey<T> key, ConfigOption<T> option) throws IllegalStateException
      Adds a new config option with a given key.
      Type Parameters:
      T - Type of the option
      Parameters:
      key - Key of the config option
      option - Config option
      Throws:
      IllegalStateException - If key is already associated with an option.
    • hasOption Link icon

      public boolean hasOption(ConfigKey<?> key)
      Checks whether this config has an option with a given key.
      Parameters:
      key - Key of the option
    • getOption Link icon

      public <T> T getOption(ConfigKey<T> key)
      Returns the value of an option.
      Type Parameters:
      T - Type of the option
      Parameters:
      key - Key of the config option
      Returns:
      Value of the option associated with key
    • setOption Link icon

      public <T> void setOption(ConfigKey<T> key, T value) throws IllegalArgumentException
      Sets the value of an option.
      Type Parameters:
      T - Type of the option
      Parameters:
      key - Key of the config option
      value - New value for the option associated with key
      Throws:
      IllegalArgumentException - If the option has a validator that evaluates to false for value.
    • resetOption Link icon

      public void resetOption(ConfigKey<?> key)
      Resets an option to its initial value.
      Parameters:
      key - Key of the config option
    • getKeys Link icon

      public Collection<ConfigKey<?>> getKeys()
    • getOptions Link icon

      public Collection<ConfigOption<?>> getOptions()
      Returns the collection of options in this configuration.
    • copyFrom Link icon

      public void copyFrom(Config otherConfig)
      Copies all options from another config.
      Parameters:
      otherConfig - Config to copy from
    • copyFrom Link icon

      public void copyFrom(Config otherConfig, Collection<ConfigKey<?>> keys)
      Copies all options from another config based on a collection of keys.
      Parameters:
      otherConfig - The config to copy from
      keys - The keys of the options to copy
    • copyFrom Link icon

      public <T> void copyFrom(Config otherConfig, ConfigKey<T> key)
      Copies an option with a given key from another config.
      Parameters:
      otherConfig - Config to copy from
      key - Key of the option to copy
    • reset Link icon

      public void reset()
      Resets all config options to their initial values.