43 lines
948 B
Go
43 lines
948 B
Go
package hero
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type apiComp struct {
|
|
modules.MCompGate
|
|
service core.IService
|
|
moduleHero *Hero
|
|
user comm.IUser
|
|
}
|
|
|
|
const ( //消息回复的头名称
|
|
StrengthenUplv = "strengthenherolv"
|
|
HeroSubTypeInfo = "info" //英雄卡片信息
|
|
HeroSubTypeList = "list" //英雄列表
|
|
HeroSubTypeChouka = "chouka" //抽卡
|
|
)
|
|
|
|
//组件初始化接口
|
|
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
|
err = this.MCompGate.Init(service, module, comp, options)
|
|
this.moduleHero = module.(*Hero)
|
|
this.service = service
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Start() (err error) {
|
|
err = this.MCompGate.Start()
|
|
|
|
var module core.IModule
|
|
|
|
if module, err = this.service.GetModule(comm.ModuleUser); err != nil {
|
|
return
|
|
}
|
|
this.user = module.(comm.IUser)
|
|
|
|
return
|
|
}
|