58 lines
1.5 KiB
Go
58 lines
1.5 KiB
Go
package uniongve
|
|
|
|
import (
|
|
"fmt"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
)
|
|
|
|
const (
|
|
game_guildboss = "game_guildboss.json"
|
|
game_guildbossrank = "game_guildbossrank.json"
|
|
game_guildbossroulette = "game_guildbossroulette.json"
|
|
game_guildbossscore = "game_guildbossscore.json"
|
|
)
|
|
|
|
// /配置管理基础组件
|
|
type MCompConfigure struct {
|
|
modules.MCompConfigure
|
|
}
|
|
|
|
// 组件初始化接口
|
|
func (this *MCompConfigure) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
|
err = this.ModuleCompBase.Init(service, module, comp, options)
|
|
err = this.LoadMultiConfigure(map[string]interface{}{
|
|
game_guildboss: cfg.NewGameGuildBoss,
|
|
game_guildbossrank: cfg.NewGameGuildBossRank,
|
|
game_guildbossroulette: cfg.NewGameGuildBossRoulette,
|
|
game_guildbossscore: cfg.NewGameGuildBossScore,
|
|
})
|
|
err = this.LoadConfigure(game_guildboss, cfg.NewGameGuildBoss)
|
|
return
|
|
}
|
|
|
|
// 获取所有难度一的boos
|
|
func (this *MCompConfigure) getguildboss() (results []*cfg.GameGuildBossData, err error) {
|
|
var (
|
|
v interface{}
|
|
)
|
|
|
|
if v, err = this.GetConfigure(game_guildboss); err != nil {
|
|
return
|
|
} else {
|
|
data, ok := v.(*cfg.GameGuildBoss)
|
|
if !ok {
|
|
err = fmt.Errorf("%T no is *cfg.GameGuildActivity", v)
|
|
return
|
|
}
|
|
results = make([]*cfg.GameGuildBossData, 0)
|
|
for _, v := range data.GetDataList() {
|
|
if v.BossLv == 1 {
|
|
results = append(results, v)
|
|
}
|
|
}
|
|
return
|
|
}
|
|
}
|