55 lines
1.3 KiB
Go
55 lines
1.3 KiB
Go
package tools
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
)
|
|
|
|
func NewModule() core.IModule {
|
|
m := new(Tools)
|
|
return m
|
|
}
|
|
|
|
type Tools struct {
|
|
modules.ModuleBase
|
|
configure *MCompConfigure
|
|
}
|
|
|
|
//模块名
|
|
func (this *Tools) GetType() core.M_Modules {
|
|
return comm.ModuleTools
|
|
}
|
|
|
|
//模块初始化接口 注册用户创建角色事件
|
|
func (this *Tools) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
err = this.ModuleBase.Init(service, module, options)
|
|
return
|
|
}
|
|
|
|
//模块初始化接口 注册用户创建角色事件
|
|
func (this *Tools) Start() (err error) {
|
|
err = this.ModuleBase.Start()
|
|
return
|
|
}
|
|
|
|
//装备组件
|
|
func (this *Tools) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.configure = this.RegisterComp(new(MCompConfigure)).(*MCompConfigure)
|
|
}
|
|
|
|
func (this *Tools) GetGroupDataByLottery(lotteryId int32, vipLv int32, lv int32) (items []*cfg.Gameatn) {
|
|
items = this.configure.GetGroupDataByLottery(lotteryId, vipLv, lv)
|
|
return
|
|
}
|
|
|
|
func (this *Tools) GetGlobalConf() *cfg.GameGlobalData {
|
|
return this.configure.GetGlobalConf()
|
|
}
|
|
|
|
func (this *Tools) GetPriceGroupCost(pricegroupId int32, purchase int32) (res []*cfg.Gameatn) {
|
|
return this.configure.GetPriceGroupCost(pricegroupId, purchase)
|
|
}
|