diff --git a/bin/json/game_heroexp.json b/bin/json/game_heroexp.json new file mode 100644 index 000000000..9e333403f --- /dev/null +++ b/bin/json/game_heroexp.json @@ -0,0 +1,50 @@ +[ + { + "hid": 42911, + "name": "初级经验精灵", + "star": 2, + "color": 1, + "heroexp": 1000, + "skilllevelup": 0 + }, + { + "hid": 43911, + "name": "中级经验精灵", + "star": 3, + "color": 2, + "heroexp": 5000, + "skilllevelup": 0 + }, + { + "hid": 44911, + "name": "高级经验精灵", + "star": 4, + "color": 3, + "heroexp": 20000, + "skilllevelup": 0 + }, + { + "hid": 43921, + "name": "技能精灵·稀有", + "star": 3, + "color": 2, + "heroexp": 0, + "skilllevelup": 1 + }, + { + "hid": 44921, + "name": "技能精灵·史诗", + "star": 4, + "color": 3, + "heroexp": 0, + "skilllevelup": 1 + }, + { + "hid": 45921, + "name": "技能精灵·传说", + "star": 5, + "color": 4, + "heroexp": 0, + "skilllevelup": 1 + } +] \ No newline at end of file diff --git a/modules/hero/configure_comp.go b/modules/hero/configure_comp.go index de21c1bab..dd3711f16 100644 --- a/modules/hero/configure_comp.go +++ b/modules/hero/configure_comp.go @@ -14,6 +14,7 @@ const ( game_heroLevelgrow = "game_heroLevelgrow.json" game_heroStarup = "game_heroStarup.json" game_heroLevelup = "game_heroLevelup.json" + game_heroExp = "game_exp.json" ) ///配置管理组件 @@ -29,6 +30,7 @@ func (this *Configure_Comp) Init(service core.IService, module core.IModule, com this.LoadConfigure(game_heroLevelgrow, cfg.NewGame_heroLevelgrow) this.LoadConfigure(game_heroStarup, cfg.NewGame_heroStarup) this.LoadConfigure(game_heroLevelup, cfg.NewGame_heroLevelup) + this.LoadConfigure(game_heroExp, cfg.NewGame_heroExp) return } diff --git a/sys/configure/structs/game.heroExp.go b/sys/configure/structs/game.heroExp.go new file mode 100644 index 000000000..73283f657 --- /dev/null +++ b/sys/configure/structs/game.heroExp.go @@ -0,0 +1,42 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +type Game_heroExp struct { + _dataMap map[int32]*Game_heroExpData + _dataList []*Game_heroExpData +} + +func NewGame_heroExp(_buf []map[string]interface{}) (*Game_heroExp, error) { + _dataList := make([]*Game_heroExpData, 0, len(_buf)) + dataMap := make(map[int32]*Game_heroExpData) + for _, _ele_ := range _buf { + if _v, err2 := NewGame_heroExpData(_ele_); err2 != nil { + return nil, err2 + } else { + _dataList = append(_dataList, _v) + dataMap[_v.Hid] = _v + } + } + return &Game_heroExp{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *Game_heroExp) GetDataMap() map[int32]*Game_heroExpData { + return table._dataMap +} + +func (table *Game_heroExp) GetDataList() []*Game_heroExpData { + return table._dataList +} + +func (table *Game_heroExp) Get(key int32) *Game_heroExpData { + return table._dataMap[key] +} + + diff --git a/sys/configure/structs/game.heroExpData.go b/sys/configure/structs/game.heroExpData.go new file mode 100644 index 000000000..a48bbdeb4 --- /dev/null +++ b/sys/configure/structs/game.heroExpData.go @@ -0,0 +1,35 @@ + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +package cfg + +import "errors" + +type Game_heroExpData struct { + Hid int32 + Name string + Star int32 + Color int32 + Heroexp int32 + Skilllevelup int32 +} + +func (Game_heroExpData) GetTypeId() int { + return 2029779473 +} + +func NewGame_heroExpData(_buf map[string]interface{}) (_v *Game_heroExpData, err error) { + _v = &Game_heroExpData{} + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hid"].(float64); !_ok_ { err = errors.New("hid error"); return }; _v.Hid = int32(_tempNum_) } + { var _ok_ bool; if _v.Name, _ok_ = _buf["name"].(string); !_ok_ { err = errors.New("name error"); return } } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["color"].(float64); !_ok_ { err = errors.New("color error"); return }; _v.Color = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["heroexp"].(float64); !_ok_ { err = errors.New("heroexp error"); return }; _v.Heroexp = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skilllevelup"].(float64); !_ok_ { err = errors.New("skilllevelup error"); return }; _v.Skilllevelup = int32(_tempNum_) } + return +}