Documentation ¶
Overview ¶
Package settings provides a simple interface for storing and retrieving game settings.
Index ¶
- func Get(key string) any
- func GetBool(key string) bool
- func GetFloat(key string) float64
- func GetInt(key string) int
- func GetKeys() []string
- func GetString(key string) string
- func GetStrings(key string) []string
- func LoadSettings() error
- func SaveSettings() error
- func Set(key string, value any)
- func SetSettings(s Settings)
- type Settings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKeys ¶ added in v0.0.6
func GetKeys() []string
GetKeys returns the keys in the global settings store.
func GetStrings ¶ added in v0.0.6
GetStrings returns a slice of strings from the global settings store.
func LoadSettings ¶
func LoadSettings() error
LoadSettings loads settings from the global settings store.
func SaveSettings ¶
func SaveSettings() error
SaveSettings saves settings to the global settings store.
func SetSettings ¶ added in v0.0.6
func SetSettings(s Settings)
SetSettings sets the global settings store.
Types ¶
type Settings ¶
type Settings interface { LoadSettings() error SaveSettings() error Get(key string) any GetString(key string) string GetStrings(key string) []string GetInt(key string) int GetFloat(key string) float64 GetBool(key string) bool Set(key string, value any) GetKeys() []string }
Settings is an interface for a game settings store.
Click to show internal directories.
Click to hide internal directories.