go_dreamfactory/modules/autoBattle/api.go
2022-12-28 15:54:53 +08:00

37 lines
786 B
Go

package autoBattle
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
const ()
type apiComp struct {
modules.MCompGate
service core.IService
configure *configureComp
module *AutoBattle
viking comm.IViking
}
//组件初始化接口
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.module = module.(*AutoBattle)
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.ModuleViking); err != nil {
return
}
this.viking = module.(comm.IViking)
return
}