go_dreamfactory/modules/integral/module.go

55 lines
1.2 KiB
Go

package integral
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type Integral struct {
modules.ModuleBase
modelIntegral *modelIntegral
api *apiComp
configure *configureComp
battle comm.IBattle
service base.IRPCXService
}
func NewModule() core.IModule {
return &Integral{}
}
func (this *Integral) GetType() core.M_Modules {
return comm.ModuleIntegral
}
func (this *Integral) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
if err = this.ModuleBase.Init(service, module, options); err != nil {
return
}
this.service = service.(base.IRPCXService)
return
}
func (this *Integral) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
var module core.IModule
if module, err = this.service.GetModule(comm.ModuleBattle); err != nil {
return
}
this.battle = module.(comm.IBattle)
return
}
func (this *Integral) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelIntegral = this.RegisterComp(new(modelIntegral)).(*modelIntegral)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}