Wiki > ProjectPrefs

ProjectPrefs class


Class used to manage the preferences.

Namespace: RotaryHeart.Lib.ProjectPreferences
Package: ProjectPrefs

Syntax


public class ProjectPrefs

Properties


Accessibility Level Type Name Description
public const string AssetPath Path to the .ini file where the data is going to be saved.

Methods


Accessibility Level Type Name Description
public static void Clear() Erases every preference from the file.
public static bool GetBool(string, string, bool) Returns the bool value corresponding to key in the preference file if it exists.
public static float GetFloat(string, string, float) Returns the float value corresponding to key in the preference file if it exists.
public static int GetInt(string, string, int) Returns the int value corresponding to key in the preference file if it exists.
public static string[] GetKeys(string) Returns the keys saved on the specified section.
public static string[] GetSections() Returns the sections saved on the preferences.
public static string GetString(string, string, string) Returns the string value corresponding to key in the preference file if it exists.
public static string[] GetValues(string) Returns the values stored on a section.
public static bool HasKey(string, string) Check if the file contains a specific key.
public static bool HasSection(string) Check if the file contains the specified section.
public static bool RemoveKey(string, string) Removes a key from a specific sub section.
public static bool RemoveSection(string) Removes a sub section from the file.
public static void ResetParser() Reset the parser so that it reloads again.
public static void Save() Saves the preferences to the file.
public static void SetBool(string, string, bool) Sets the bool value of the preference identified by key.
public static void SetFloat(string, string, float) Sets the float value of the preference identified by key.
public static void SetInt(string, string, int) Sets the int value of the preference identified by key.
public static void SetString(string, string, string) Sets the string value of the preference identified by key.