go_dreamfactory/modules/island/module.go
2023-10-30 15:58:50 +08:00

61 lines
1.3 KiB
Go

package island
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
/*
模块名:Pack
描述:背包系统模块
开发:李伟
*/
func NewModule() core.IModule {
m := new(IsLand)
return m
}
type IsLand struct {
modules.ModuleBase
service base.IRPCXService
battle comm.IBattle
api *apiComp
model *modelComp
modelhero *modelHeroComp
configure *ConfigureComp
}
func (this *IsLand) GetType() core.M_Modules {
return comm.ModuleGameInvite
}
func (this *IsLand) 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.(comm.IService)
return
}
func (this *IsLand) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
this.modelhero = this.RegisterComp(new(modelHeroComp)).(*modelHeroComp)
this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp)
}
func (this *IsLand) 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
}