go_dreamfactory/modules/oldtimes/module.go

53 lines
1.2 KiB
Go

package oldtimes
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type Oldtimes struct {
modules.ModuleBase
combat comm.ICombat
api *apiComp
service base.IRPCXService
configure *configureComp
modelOldtimes *ModelOldtimes
}
func NewModule() core.IModule {
return &Oldtimes{}
}
func (this *Oldtimes) 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 *Oldtimes) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.modelOldtimes = this.RegisterComp(new(ModelOldtimes)).(*ModelOldtimes)
}
func (this *Oldtimes) GetType() core.M_Modules {
return comm.ModuleOldtimes
}
func (this *Oldtimes) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
var module core.IModule
if module, err = this.service.GetModule(comm.ModuleCombat); err != nil {
return
}
this.combat = module.(comm.ICombat)
return
}