47 lines
1.0 KiB
Go
47 lines
1.0 KiB
Go
package plunder
|
|
|
|
import (
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
"sync"
|
|
)
|
|
|
|
const (
|
|
monkey_main = "game_monkeymain.json"
|
|
)
|
|
|
|
type configureComp struct {
|
|
modules.MCompConfigure
|
|
module *Plunder
|
|
hlock sync.RWMutex
|
|
}
|
|
|
|
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)
|
|
this.module = module.(*Plunder)
|
|
err = this.LoadConfigure(monkey_main, cfg.NewGameMonkeyMain)
|
|
|
|
return
|
|
}
|
|
|
|
// 通过章节id 获取信息
|
|
func (this *configureComp) getGameMonkeyData(id int32) (result *cfg.GameMonkeyMainData, err error) {
|
|
var (
|
|
v interface{}
|
|
ok bool
|
|
)
|
|
if v, err = this.GetConfigure(monkey_main); err == nil {
|
|
if result, ok = v.(*cfg.GameMonkeyMain).GetDataMap()[id]; ok {
|
|
return
|
|
}
|
|
}
|
|
return
|
|
}
|
|
|
|
// 获取章节对应的奖励
|
|
func (this *configureComp) getGameMonkeyRewardData(chapterid int32) (result []*cfg.GameMonkeyRewardData, err error) {
|
|
|
|
return
|
|
}
|