settings

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package settings provides a simple interface for storing and retrieving game settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v0.0.6

func Get(key string) any

Get returns a value from the global settings store.

func GetBool added in v0.0.6

func GetBool(key string) bool

GetBool returns a bool from the global settings store.

func GetFloat added in v0.0.6

func GetFloat(key string) float64

GetFloat returns a float64 from the global settings store.

func GetInt added in v0.0.6

func GetInt(key string) int

GetInt returns an int from the global settings store.

func GetKeys added in v0.0.6

func GetKeys() []string

GetKeys returns the keys in the global settings store.

func GetString added in v0.0.6

func GetString(key string) string

GetString returns a string from the global settings store.

func GetStrings added in v0.0.6

func GetStrings(key string) []string

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 Set added in v0.0.6

func Set(key string, value any)

Set sets a value in 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.

func GetGlobal added in v0.0.6

func GetGlobal() Settings

GetGlobal returns the global settings store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL