package parkour import ( "fmt" "go_dreamfactory/lego/core" "go_dreamfactory/modules" cfg "go_dreamfactory/sys/configure/structs" ) const ( game_buzkashigrade = "game_buzkashigrade.json" game_buzkashilv = "game_buzkashilv.json" game_buzkashimount = "game_buzkashimount.json" game_buzkashireward = "game_buzkashireward.json" ) ///背包配置管理组件 type configureComp struct { modules.MCompConfigure module *Parkour } //组件初始化接口 func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.MCompConfigure.Init(service, module, comp, options) this.module = module.(*Parkour) this.LoadConfigure(game_buzkashigrade, cfg.NewGameBuzkashiGrade) this.LoadConfigure(game_buzkashilv, cfg.NewGameBuzkashiLv) this.LoadConfigure(game_buzkashimount, cfg.NewGameBuzkashiMount) this.LoadConfigure(game_buzkashireward, cfg.NewGameBuzkashiReward) return } //查询坐骑表 func (this *configureComp) getGameBuzkashiMount(id string) (configure *cfg.GameBuzkashiMountData, err error) { var ( v interface{} ok bool ) if v, err = this.GetConfigure(game_buzkashimount); err != nil { this.module.Errorln(err) return } else { if configure, ok = v.(*cfg.GameBuzkashiMount).GetDataMap()[id]; !ok { err = fmt.Errorf("not found:%s ", id) this.module.Errorln(err) return } } return }