package plunder import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" "go_dreamfactory/pb" ) func NewModule() core.IModule { m := new(Plunder) return m } /* 模块名称:猜颜色 */ type Plunder struct { modules.ModuleBase service comm.IService api *apiComp configure *configureComp modelPlunder *modelPlunder modelLand *modelLand battle comm.IBattle modelRecord *modelRecord battlerecord comm.IBattleRecord // 战报模块 } // 模块名 func (this *Plunder) GetType() core.M_Modules { return comm.ModulePlunder } // 模块初始化接口 func (this *Plunder) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.service = service.(comm.IService) if module, err = this.service.GetModule(comm.ModuleBattle); err != nil { return } this.battle = module.(comm.IBattle) return } func (this *Plunder) Start() (err error) { if err = this.ModuleBase.Start(); err != nil { return } return } func (this *Plunder) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api = this.RegisterComp(new(apiComp)).(*apiComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.modelPlunder = this.RegisterComp(new(modelPlunder)).(*modelPlunder) this.modelLand = this.RegisterComp(new(modelLand)).(*modelLand) this.modelRecord = this.RegisterComp(new(modelRecord)).(*modelRecord) this.modelRecord = this.RegisterComp(new(modelRecord)).(*modelRecord) } func (this *Plunder) CreatePlunderLand(uid string) (land *pb.DBPlunderLand, err error) { return this.modelLand.createPlunderLandData(uid) }