上传战斗配置
This commit is contained in:
parent
36c8b45e57
commit
38eceed9d4
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/sys/configure"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
"sync"
|
||||
)
|
||||
@ -32,26 +33,26 @@ type configureComp struct {
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.MCompConfigure.Init(service, module, comp, options)
|
||||
this.module = module.(*Battle)
|
||||
// this.LoadConfigure(game_equipsuit, cfg.NewGameEquipSuit)
|
||||
// this.LoadConfigure(game_monster, cfg.NewGameMonster)
|
||||
// configure.RegisterConfigure(game_monsterformat, cfg.NewGameMonsterFormat, func() {
|
||||
// this.mformatlock.Lock()
|
||||
// if v, err := this.GetConfigure(game_monsterformat); err != nil {
|
||||
// this.module.Errorf("err:%v", err)
|
||||
// return
|
||||
// } else {
|
||||
// this.mformat = make(map[int32][]*cfg.GameMonsterFormatData)
|
||||
// for _, v := range v.(*cfg.GameMonsterFormat).GetDataList() {
|
||||
// if this.mformat[v.Id] == nil {
|
||||
// this.mformat[v.Id] = make([]*cfg.GameMonsterFormatData, 5)
|
||||
// }
|
||||
// if v.Monster != -1 {
|
||||
// this.mformat[v.Id][v.Pos-1] = v
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// this.mformatlock.Unlock()
|
||||
// })
|
||||
this.LoadConfigure(game_equipsuit, cfg.NewGameEquipSuit)
|
||||
this.LoadConfigure(game_monster, cfg.NewGameMonster)
|
||||
configure.RegisterConfigure(game_monsterformat, cfg.NewGameMonsterFormat, func() {
|
||||
this.mformatlock.Lock()
|
||||
if v, err := this.GetConfigure(game_monsterformat); err != nil {
|
||||
this.module.Errorf("err:%v", err)
|
||||
return
|
||||
} else {
|
||||
this.mformat = make(map[int32][]*cfg.GameMonsterFormatData)
|
||||
for _, v := range v.(*cfg.GameMonsterFormat).GetDataList() {
|
||||
if this.mformat[v.Id] == nil {
|
||||
this.mformat[v.Id] = make([]*cfg.GameMonsterFormatData, 5)
|
||||
}
|
||||
if v.Monster != -1 {
|
||||
this.mformat[v.Id][v.Pos-1] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
this.mformatlock.Unlock()
|
||||
})
|
||||
// configure.RegisterConfigure(game_skillatk, cfg.NewGameSkillAtk, func() {
|
||||
// this.skillatklock.Lock()
|
||||
// if v, err := this.GetConfigure(game_skillatk); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user