settings

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 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

func Get(key string) any

Get returns a value from the global settings store.

func GetBool

func GetBool(key string) bool

GetBool returns a bool from the global settings store.

func GetFloat

func GetFloat(key string) float64

GetFloat returns a float64 from the global settings store.

func GetInt

func GetInt(key string) int

GetInt returns an int from the global settings store.

func GetKeys

func GetKeys() []string

GetKeys returns the keys in the global settings store.

func GetString

func GetString(key string) string

GetString returns a string from the global settings store.

func GetStrings

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

func Set(key string, value any)

Set sets a value in the global settings store.

func SetSettings

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

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