package robot import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/lego/core/cbase" "go_dreamfactory/lego/sys/log" "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" ) const ( gameWorldTask = "game_worldtask.json" gameWorldtaskBattle = "game_worldbattle.json" game_buriedcondi = "game_buriedcondi.json" game_mainstage = "game_mainstage.json" //主线表 game_equip = "game_equip.json" //装备信息表 game_equipintensify = "game_equipintensify.json" //装备等级消耗表 game_equipenchanting = "game_equipenchanting.json" //装备附魔 equip_suit = "game_equipsuit.json" //装备套装表 // gameWorldAll = "game_worldall.json" // gameburiedCond = "game_buriedcondi.json" // gamerdtasknpc = "game_rdtasknpc.json" // gamesearchitemall = "game_searchitemall.json" // gamesearchitembox = "game_searchitembox.json" // game_worlddeal = "game_worlddeal.json" // game_worldrd = "game_worldrd.json" game_pagoda = "game_pagoda.json" ) type configureComp struct { cbase.ModuleCompBase module *RobotModule } func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { err = this.ModuleCompBase.Init(service, module, comp, options) this.module = module.(*RobotModule) configure.RegisterConfigure(gameWorldTask, cfg.NewGameWorldTask, nil) configure.RegisterConfigure(gameWorldtaskBattle, cfg.NewGameWorldBattle, nil) configure.RegisterConfigure(game_buriedcondi, cfg.NewGameBuriedCondi, nil) configure.RegisterConfigure(game_mainstage, cfg.NewGameMainStage, nil) configure.RegisterConfigure(game_equip, cfg.NewGameEquip, nil) configure.RegisterConfigure(game_equipintensify, cfg.NewGameEquipIntensify, nil) configure.RegisterConfigure(game_pagoda, cfg.NewGamePagoda, nil) configure.RegisterConfigure(equip_suit, cfg.NewGameEquipSuit, nil) return } //获取任务配置 func (this *configureComp) getGameWorldTaskData(tid int32) (conf *cfg.GameWorldTaskData, err error) { var ( v interface{} ok bool ) if v, err = configure.GetConfigure(gameWorldTask); err != nil { return } else { if conf, ok = v.(*cfg.GameWorldTask).GetDataMap()[tid]; !ok { err = comm.NewNotFoundConfErr(string(this.module.GetType()), gameWorldTask, tid) log.Errorf("err:%v", err) return } } return } //获取战斗配置 func (this *configureComp) getGameWorldBattleData(confId int32) (conf *cfg.GameWorldBattleData, err error) { var ( v interface{} ok bool ) if v, err = configure.GetConfigure(gameWorldtaskBattle); err != nil { return } else { if conf, ok = v.(*cfg.GameWorldBattle).GetDataMap()[confId]; !ok { err = comm.NewNotFoundConfErr(string(this.module.GetType()), gameWorldtaskBattle, confId) log.Errorf("err:%v", err) return } } return }