package egghunt import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" cfg "go_dreamfactory/sys/configure/structs" ) const ( game_repeatall = "game_repeatall.json" ) type configureComp struct { modules.MCompConfigure module *Egghunt } func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { err = this.MCompConfigure.Init(service, module, comp, options) err = this.LoadConfigure(game_repeatall, cfg.NewGameRepeatAll) return } // 读取装备出售系数配置 func (this *configureComp) getGameRepeatAllData(id int32) (result *cfg.GameRepeatAllData, err error) { var ( v interface{} ok bool ) if v, err = this.GetConfigure(game_repeatall); err != nil { this.module.Errorf("err:%v", err) return } else { if result, ok = v.(*cfg.GameRepeatAll).GetDataMap()[id]; !ok { err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_repeatall, id) return } } return }