//------------------------------------------------------------------------------ // // 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 GameHeroExpData struct { Hid string Name string Star int32 Color int32 Heroexp int32 Skilllevelup int32 Needgold int32 } const TypeId_GameHeroExpData = -1440094703 func (*GameHeroExpData) GetTypeId() int32 { return -1440094703 } func (_v *GameHeroExpData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; if _v.Hid, _ok_ = _buf["hid"].(string); !_ok_ { err = errors.New("hid error"); return } } { 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_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["needgold"].(float64); !_ok_ { err = errors.New("needgold error"); return }; _v.Needgold = int32(_tempNum_) } return } func DeserializeGameHeroExpData(_buf map[string]interface{}) (*GameHeroExpData, error) { v := &GameHeroExpData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }