package battle import ( "errors" "go_dreamfactory/lego/sys/log" "go_dreamfactory/lego/utils/mapstructure" "go_dreamfactory/modules" ) type ( IOptions interface { modules.IOptions } Options struct { modules.Options OpenCheck bool BattleServerAddr string } ) func (this *Options) GetDebug() bool { return this.Debug } func (this *Options) GetLog() log.ILogger { return this.Log } func (this *Options) GetBattleServerAddr() string { return this.BattleServerAddr } func (this *Options) LoadConfig(settings map[string]interface{}) (err error) { if settings != nil { if err = mapstructure.Decode(settings, &this.Options); err != nil { return } if err = mapstructure.Decode(settings, this); err != nil { return } } if this.Log = log.NewTurnlog(true, log.Clone("", 4)); this.Log == nil { err = errors.New("log is nil") } return }