//------------------------------------------------------------------------------ // // 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 GameHeroStargrowData struct { Star int32 Level int32 Maxlevel int32 StarupHp float32 StarupAtk float32 StarupDef float32 StarupSpeed float32 } const TypeId_GameHeroStargrowData = 1866894917 func (*GameHeroStargrowData) GetTypeId() int32 { return 1866894917 } func (_v *GameHeroStargrowData)Deserialize(_buf map[string]interface{}) (err error) { { 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["level"].(float64); !_ok_ { err = errors.New("level error"); return }; _v.Level = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["maxlevel"].(float64); !_ok_ { err = errors.New("maxlevel error"); return }; _v.Maxlevel = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["starup_hp"].(float64); !_ok_ { err = errors.New("starup_hp error"); return }; _v.StarupHp = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["starup_atk"].(float64); !_ok_ { err = errors.New("starup_atk error"); return }; _v.StarupAtk = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["starup_def"].(float64); !_ok_ { err = errors.New("starup_def error"); return }; _v.StarupDef = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["starup_speed"].(float64); !_ok_ { err = errors.New("starup_speed error"); return }; _v.StarupSpeed = float32(_tempNum_) } return } func DeserializeGameHeroStargrowData(_buf map[string]interface{}) (*GameHeroStargrowData, error) { v := &GameHeroStargrowData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }