41 lines
884 B
Go
41 lines
884 B
Go
package worldtask
|
|
|
|
import (
|
|
"fmt"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
)
|
|
|
|
const (
|
|
gameWorldTask = "game_worldtask.json"
|
|
)
|
|
|
|
type configureComp struct {
|
|
modules.MCompConfigure
|
|
}
|
|
|
|
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.LoadMultiConfigure(map[string]interface{}{
|
|
gameWorldTask: cfg.NewGameWorldTask,
|
|
})
|
|
return
|
|
}
|
|
|
|
func (this *configureComp) getWorldtaskCfg() (data *cfg.GameWorldTask, err error) {
|
|
var (
|
|
v interface{}
|
|
ok bool
|
|
)
|
|
if v, err = this.GetConfigure(gameWorldTask); err != nil {
|
|
return
|
|
} else {
|
|
if data, ok = v.(*cfg.GameWorldTask); !ok {
|
|
err = fmt.Errorf("%T is *cfg.GameWorldTask", v)
|
|
return
|
|
}
|
|
}
|
|
return
|
|
}
|