//------------------------------------------------------------------------------ // // 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 GamemodelData struct { Id int32 Preson string Presonshow string Ico string Fight string Img string Heroimg string Portrait string Postxyz []float32 } const TypeId_GamemodelData = -1307411593 func (*GamemodelData) GetTypeId() int32 { return -1307411593 } func (_v *GamemodelData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } { var _ok_ bool; if _v.Preson, _ok_ = _buf["preson"].(string); !_ok_ { err = errors.New("preson error"); return } } { var _ok_ bool; if _v.Presonshow, _ok_ = _buf["presonshow"].(string); !_ok_ { err = errors.New("presonshow error"); return } } { var _ok_ bool; if _v.Ico, _ok_ = _buf["ico"].(string); !_ok_ { err = errors.New("ico error"); return } } { var _ok_ bool; if _v.Fight, _ok_ = _buf["fight"].(string); !_ok_ { err = errors.New("fight error"); return } } { var _ok_ bool; if _v.Img, _ok_ = _buf["img"].(string); !_ok_ { err = errors.New("img error"); return } } { var _ok_ bool; if _v.Heroimg, _ok_ = _buf["heroimg"].(string); !_ok_ { err = errors.New("heroimg error"); return } } { var _ok_ bool; if _v.Portrait, _ok_ = _buf["portrait"].(string); !_ok_ { err = errors.New("portrait error"); return } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["postxyz"].([]interface{}); !_ok_ { err = errors.New("postxyz error"); return } _v.Postxyz = make([]float32, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ float32 { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = float32(_x_) } _v.Postxyz = append(_v.Postxyz, _list_v_) } } return } func DeserializeGamemodelData(_buf map[string]interface{}) (*GamemodelData, error) { v := &GamemodelData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }