//------------------------------------------------------------------------------ // // 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 GameMonsterData struct { MonsterId int32 HeroId string Name string Star int32 Equip2 int32 Equip4 int32 Skill1 int32 Skill2 int32 Skill3 int32 Speed int32 } const TypeId_GameMonsterData = 31965864 func (*GameMonsterData) GetTypeId() int32 { return 31965864 } func (_v *GameMonsterData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["monster_id"].(float64); !_ok_ { err = errors.New("monster_id error"); return }; _v.MonsterId = int32(_tempNum_) } { var _ok_ bool; if _v.HeroId, _ok_ = _buf["hero_id"].(string); !_ok_ { err = errors.New("hero_id error"); return } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text 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["equip2"].(float64); !_ok_ { err = errors.New("equip2 error"); return }; _v.Equip2 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["equip4"].(float64); !_ok_ { err = errors.New("equip4 error"); return }; _v.Equip4 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill1"].(float64); !_ok_ { err = errors.New("skill1 error"); return }; _v.Skill1 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill2"].(float64); !_ok_ { err = errors.New("skill2 error"); return }; _v.Skill2 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill3"].(float64); !_ok_ { err = errors.New("skill3 error"); return }; _v.Skill3 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["speed"].(float64); !_ok_ { err = errors.New("speed error"); return }; _v.Speed = int32(_tempNum_) } return } func DeserializeGameMonsterData(_buf map[string]interface{}) (*GameMonsterData, error) { v := &GameMonsterData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }