go_dreamfactory/modules/game/module.go
2022-06-28 14:51:58 +08:00

42 lines
866 B
Go

package game
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
/*
模块名:游戏模块
描述:游戏战斗逻辑模块
开发:李伟
*/
func NewModule() core.IModule {
m := new(Game)
return m
}
type Game struct {
modules.ModuleBase
api *ApiComp
configure *ConfigureComp
}
//模块名
func (this *Game) GetType() core.M_Modules {
return comm.SM_EquipmentModule
}
//模块初始化接口 注册用户创建角色事件
func (this *Game) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
//装备组件
func (this *Game) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(ApiComp)).(*ApiComp)
this.configure = this.RegisterComp(new(ConfigureComp)).(*ConfigureComp)
}