83 lines
2.0 KiB
Go
83 lines
2.0 KiB
Go
package reddot
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/base"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
/*
|
|
模块名:红点系统
|
|
描述:统一获取红点信息
|
|
开发:李伟
|
|
*/
|
|
func NewModule() core.IModule {
|
|
m := new(Reddot)
|
|
return m
|
|
}
|
|
|
|
type Reddot struct {
|
|
modules.ModuleBase
|
|
service base.IRPCXService
|
|
mainline comm.IMainline
|
|
pagoda comm.IPagoda
|
|
martialhall comm.IMartialhall
|
|
horoscope comm.IHoroscope
|
|
arena comm.IArena
|
|
gourmet comm.IGourmet
|
|
// mail comm.Imail
|
|
api_comp *apiComp
|
|
}
|
|
|
|
//模块名
|
|
func (this *Reddot) GetType() core.M_Modules {
|
|
return comm.ModuleReddot
|
|
}
|
|
|
|
//模块初始化接口 注册用户创建角色事件
|
|
func (this *Reddot) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
err = this.ModuleBase.Init(service, module, options)
|
|
this.service = service.(base.IRPCXService)
|
|
return
|
|
}
|
|
func (this *Reddot) Start() (err error) {
|
|
err = this.ModuleBase.Start()
|
|
var module core.IModule
|
|
if module, err = this.service.GetModule(comm.ModuleMainline); err != nil {
|
|
return
|
|
}
|
|
this.mainline = module.(comm.IMainline)
|
|
if module, err = this.service.GetModule(comm.ModulePagoda); err != nil {
|
|
return
|
|
}
|
|
this.pagoda = module.(comm.IPagoda)
|
|
if module, err = this.service.GetModule(comm.ModuleMartialhall); err != nil {
|
|
return
|
|
}
|
|
this.martialhall = module.(comm.IMartialhall)
|
|
if module, err = this.service.GetModule(comm.ModuleHoroscope); err != nil {
|
|
return
|
|
}
|
|
this.horoscope = module.(comm.IHoroscope)
|
|
if module, err = this.service.GetModule(comm.ModuleArena); err != nil {
|
|
return
|
|
}
|
|
this.arena = module.(comm.IArena)
|
|
if module, err = this.service.GetModule(comm.ModuleGourmet); err != nil {
|
|
return
|
|
}
|
|
this.gourmet = module.(comm.IGourmet)
|
|
// if module, err = this.service.GetModule(comm.ModuleMail); err != nil {
|
|
// return
|
|
// }
|
|
// this.mail = module.(comm.Imail)
|
|
return
|
|
}
|
|
|
|
//装备组件
|
|
func (this *Reddot) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp)
|
|
}
|