go_dreamfactory/modules/robot/module.go

62 lines
1.5 KiB
Go

package robot
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
)
/*
模块名:红点系统
描述:统一获取红点信息
开发:李伟
*/
func NewModule() core.IModule {
m := new(RobotModule)
return m
}
type RobotModule struct {
cbase.ModuleBase
options *Options
service base.IRPCXService
robotmgr *robotmgrComp
configure *configureComp
statisticalComp *statisticalComp
}
// 模块名
func (this *RobotModule) GetType() core.M_Modules {
return comm.ModuleRobot
}
// 重构模块配置对象
func (this *RobotModule) NewOptions() (options core.IModuleOptions) {
return new(Options)
}
// 模块初始化接口 注册用户创建角色事件
func (this *RobotModule) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
if err = this.ModuleBase.Init(service, module, options); err != nil {
return
}
this.options = options.(*Options)
this.service = service.(base.IRPCXService)
return
}
func (this *RobotModule) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
return
}
// 装备组件
func (this *RobotModule) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.robotmgr = this.RegisterComp(new(robotmgrComp)).(*robotmgrComp)
this.statisticalComp = this.RegisterComp(new(statisticalComp)).(*statisticalComp)
}