//------------------------------------------------------------------------------ // // 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 GameBlockData struct { Key int32 Color int32 Belongto int32 Open int32 Icon string Weight int32 Score int32 Type int32 Value int32 } const TypeId_GameBlockData = -1717313829 func (*GameBlockData) GetTypeId() int32 { return -1717313829 } func (_v *GameBlockData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = 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["belongto"].(float64); !_ok_ { err = errors.New("belongto error"); return }; _v.Belongto = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["open"].(float64); !_ok_ { err = errors.New("open error"); return }; _v.Open = int32(_tempNum_) } { var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["score"].(float64); !_ok_ { err = errors.New("score error"); return }; _v.Score = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["value"].(float64); !_ok_ { err = errors.New("value error"); return }; _v.Value = int32(_tempNum_) } return } func DeserializeGameBlockData(_buf map[string]interface{}) (*GameBlockData, error) { v := &GameBlockData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }