From 646244d996b2371ed2c81d7b05f860e806fe2f81 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 12 Sep 2023 10:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=BC=96=E8=AF=91=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sys/configure/structs/Game.MainStageData.go | 2 -- sys/configure/structs/Game.Trainlv.go | 14 +++++++++++--- sys/configure/structs/game.globalData.go | 2 -- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sys/configure/structs/Game.MainStageData.go b/sys/configure/structs/Game.MainStageData.go index 95866b869..7596223cd 100644 --- a/sys/configure/structs/Game.MainStageData.go +++ b/sys/configure/structs/Game.MainStageData.go @@ -27,7 +27,6 @@ type GameMainStageData struct { Bubbletalk string Venturetype int32 Ventureavatar []string - SceneEffectfilter string Herocolor int32 Heroimg string Bubbletext string @@ -108,7 +107,6 @@ func (_v *GameMainStageData)Deserialize(_buf map[string]interface{}) (err error) } } - { var _ok_ bool; if _v.SceneEffectfilter, _ok_ = _buf["scene_effectfilter"].(string); !_ok_ { err = errors.New("scene_effectfilter error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["herocolor"].(float64); !_ok_ { err = errors.New("herocolor error"); return }; _v.Herocolor = int32(_tempNum_) } { var _ok_ bool; if _v.Heroimg, _ok_ = _buf["heroimg"].(string); !_ok_ { err = errors.New("heroimg error"); return } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["bubbletext"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Bubbletext error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Bubbletext, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } diff --git a/sys/configure/structs/Game.Trainlv.go b/sys/configure/structs/Game.Trainlv.go index 61ca2824d..99c861f64 100644 --- a/sys/configure/structs/Game.Trainlv.go +++ b/sys/configure/structs/Game.Trainlv.go @@ -9,26 +9,34 @@ package cfg type GameTrainlv struct { + _dataMap map[int32]*GameTrainlvData _dataList []*GameTrainlvData } func NewGameTrainlv(_buf []map[string]interface{}) (*GameTrainlv, error) { _dataList := make([]*GameTrainlvData, 0, len(_buf)) + dataMap := make(map[int32]*GameTrainlvData) for _, _ele_ := range _buf { if _v, err2 := DeserializeGameTrainlvData(_ele_); err2 != nil { return nil, err2 } else { _dataList = append(_dataList, _v) + dataMap[_v.Key] = _v } } - return &GameTrainlv{_dataList:_dataList}, nil + return &GameTrainlv{_dataList:_dataList, _dataMap:dataMap}, nil +} + +func (table *GameTrainlv) GetDataMap() map[int32]*GameTrainlvData { + return table._dataMap } func (table *GameTrainlv) GetDataList() []*GameTrainlvData { return table._dataList } -func (table *GameTrainlv) Get(index int) *GameTrainlvData { - return table._dataList[index] +func (table *GameTrainlv) Get(key int32) *GameTrainlvData { + return table._dataMap[key] } + diff --git a/sys/configure/structs/game.globalData.go b/sys/configure/structs/game.globalData.go index 7996109a1..7c663d1dd 100644 --- a/sys/configure/structs/game.globalData.go +++ b/sys/configure/structs/game.globalData.go @@ -287,7 +287,6 @@ type GameGlobalData struct { DragonInteraction int32 Dialogueclickcd float32 DoragonItem string - SignAccount int32 } const TypeId_GameGlobalData = 477542761 @@ -1132,7 +1131,6 @@ func (_v *GameGlobalData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["dragon_interaction"].(float64); !_ok_ { err = errors.New("dragon_interaction error"); return }; _v.DragonInteraction = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["dialogueclickcd"].(float64); !_ok_ { err = errors.New("dialogueclickcd error"); return }; _v.Dialogueclickcd = float32(_tempNum_) } { var _ok_ bool; if _v.DoragonItem, _ok_ = _buf["doragon_item"].(string); !_ok_ { err = errors.New("doragon_item error"); return } } - { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["sign_account"].(float64); !_ok_ { err = errors.New("sign_account error"); return }; _v.SignAccount = int32(_tempNum_) } return }