VR Development Framework
v 1.0.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
static int AVR.Core.AVR_Settings.get_int ( string  token)
inlinestatic

Get a registered setting of the type int.

Parameters
tokenToken identifying the given setting. A setting declared as domain = { setting = true } will be retrievable with the token /domain/setting.
Returns
Registered setting if a valid is found, otherwise 0.

Definition at line 66 of file AVR_Settings.cs.

67  {
68  if (settings.TryGetValue(token, out string ret))
69  {
70  return int.Parse(ret);
71  }
72  else if(!initialized) {
73  initialize();
74  return get_int(token);
75  }
76  else
77  {
78  AVR_DevConsole.warn("Settings do not contain key \"" + token + "\". Using default value 0.");
79  return 0;
80  }
81  }
static void initialize()
Initialize settings. Calling multiple times will have no effect, use reconfigure() if you want to re-...
Definition: AVR_Settings.cs:25
static Dictionary< string, string > settings
Dictionary containing all settings by their key. A setting declared as domain = { setting = true } wi...
Definition: AVR_Settings.cs:42
static bool initialized
Definition: AVR_Settings.cs:16
static int get_int(string token)
Get a registered setting of the type int.
Definition: AVR_Settings.cs:66