Files
vRp.CD2g_test/planner/configexport/example/config.go
2023-05-18 18:06:12 +08:00

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)
})
}