37 lines
769 B
Go
37 lines
769 B
Go
// Code generated by minotaur-config-export. DO NOT EDIT.
|
|
package example
|
|
import (
|
|
jsonIter "github.com/json-iterator/go"
|
|
"os"
|
|
)
|
|
|
|
var json = jsonIter.ConfigCompatibleWithStandardLibrary
|
|
var (
|
|
GameXXConfig map[int]map[string]*XXConfig
|
|
gameXXConfig map[int]map[string]*XXConfig
|
|
GameUNConfig *UNConfig
|
|
gameUNConfig *UNConfig
|
|
)
|
|
|
|
func LoadConfig(handle func(filename string, config any) error) {
|
|
handle("XXConfig.json", &gameXXConfig)
|
|
handle("UNConfig.json", &gameUNConfig)
|
|
}
|
|
|
|
func Refresh() {
|
|
GameXXConfig = gameXXConfig
|
|
GameUNConfig = gameUNConfig
|
|
}
|
|
|
|
func DefaultLoad(filepath string) {
|
|
LoadConfig(func(filename string, config any) error {
|
|
bytes, err := os.ReadFile(filepath)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return json.Unmarshal(bytes, &config)
|
|
})
|
|
}
|
|
|