Table of Contents

Class GameplaySettings

Namespace
Squiggles.Core.Data
Assembly
SquigglesCommon4X.dll

The singleton for handling gameplay settings. These are designed to be highly configurable with a provider approach.

public static class GameplaySettings
Inheritance
GameplaySettings
Inherited Members

Fields

FILE_PATH

private const string FILE_PATH = "gameplay.json"

Field Value

string

Options

The loaded options with a key-value pairing where both are strings. They are then parsed when requested.

public static readonly Dictionary<string, string> Options

Field Value

Dictionary<string, string>

Methods

GetBool(string)

Gets the option cast to a boolssss

public static bool GetBool(string key)

Parameters

key string

Returns

bool

GetFloat(string)

Gets the option cast to a float

public static float GetFloat(string key)

Parameters

key string

Returns

float

GetString(string)

Gets the option as a string (which is how it is stored so no casting occurs)

public static string GetString(string key)

Parameters

key string

Returns

string

HasKey(string)

Determines whether a key is present in the settings. Generally as long as you did everything right, this should eval true.

public static bool HasKey(string key)

Parameters

key string

the key to check for

Returns

bool

true if the key is present. False if not

Load()

public static void Load()

SaveSettings()

public static void SaveSettings()

SetBool(string, bool)

Sets an option with the given bool value

public static void SetBool(string key, bool value)

Parameters

key string
value bool

SetFloat(string, float)

Sets an option with the given float value

public static void SetFloat(string key, float value)

Parameters

key string
value float

SetString(string, string)

Sets an option with the given string value

public static void SetString(string key, string value)

Parameters

key string
value string

Events

OptionsChanged

An event that triggers whenever the options have changed. Listen to this to allow response to changes in the settings (which can be done from the pause menu!!!!)

public static event Action OptionsChanged

Event Type

Action