//------------------------------------------------------------------------------ // // 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 GameLibraryHeroData struct { Hid string Name string Star int32 History []string Favorlv []int32 Startid int32 Rightend int32 Stroyprize []*Gameatn SpecialStroyprize []*Gameatn Endid1 int32 Endid2 int32 Endid3 int32 Fid []int32 } const TypeId_GameLibraryHeroData = 1808545443 func (*GameLibraryHeroData) GetTypeId() int32 { return 1808545443 } func (_v *GameLibraryHeroData)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; 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 _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["history"].([]interface{}); !_ok_ { err = errors.New("history error"); return } _v.History = make([]string, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ string { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } } _v.History = append(_v.History, _list_v_) } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["favorlv"].([]interface{}); !_ok_ { err = errors.New("favorlv error"); return } _v.Favorlv = make([]int32, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ int32 { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } _v.Favorlv = append(_v.Favorlv, _list_v_) } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["startid"].(float64); !_ok_ { err = errors.New("startid error"); return }; _v.Startid = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rightend"].(float64); !_ok_ { err = errors.New("rightend error"); return }; _v.Rightend = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["stroyprize"].([]interface{}); !_ok_ { err = errors.New("stroyprize error"); return } _v.Stroyprize = make([]*Gameatn, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ *Gameatn { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } _v.Stroyprize = append(_v.Stroyprize, _list_v_) } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["special_stroyprize"].([]interface{}); !_ok_ { err = errors.New("special_stroyprize error"); return } _v.SpecialStroyprize = make([]*Gameatn, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ *Gameatn { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } _v.SpecialStroyprize = append(_v.SpecialStroyprize, _list_v_) } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid1"].(float64); !_ok_ { err = errors.New("endid1 error"); return }; _v.Endid1 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid2"].(float64); !_ok_ { err = errors.New("endid2 error"); return }; _v.Endid2 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid3"].(float64); !_ok_ { err = errors.New("endid3 error"); return }; _v.Endid3 = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["fid"].([]interface{}); !_ok_ { err = errors.New("fid error"); return } _v.Fid = make([]int32, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ int32 { var _ok_ bool; var _x_ float64; if _x_, _ok_ = _e_.(float64); !_ok_ { err = errors.New("_list_v_ error"); return }; _list_v_ = int32(_x_) } _v.Fid = append(_v.Fid, _list_v_) } } return } func DeserializeGameLibraryHeroData(_buf map[string]interface{}) (*GameLibraryHeroData, error) { v := &GameLibraryHeroData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }