go_dreamfactory/modules/rtask/api.go

35 lines
909 B
Go

package rtask
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
const (
RtaskSubTypeChoose = "choose" //选择
RtaskSubTypeList = "list" //随机任务列表
RtaskSubTypeApply = "apply" //做任务
RtaskSubTypeReward = "getreward" //奖励
RtaskSubTypeBattleStart = "battlestart" //战斗开始
RtaskSubTypeBattleFinish = "battlefinish" //战斗完成
)
type apiComp struct {
modules.MCompGate
service core.IService
moduleRtask *ModuleRtask
}
//组件初始化接口
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompGate.Init(service, module, comp, options)
this.moduleRtask = module.(*ModuleRtask)
this.service = service
return
}
func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start()
return
}