//------------------------------------------------------------------------------ // // 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 GameHeroupstoryChaptertxtData struct { ChapterID int32 Hero int32 Chaptername string Chaptericon string Onchapter int32 Chaptertime int32 } const TypeId_GameHeroupstoryChaptertxtData = 217018481 func (*GameHeroupstoryChaptertxtData) GetTypeId() int32 { return 217018481 } func (_v *GameHeroupstoryChaptertxtData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["chapterID"].(float64); !_ok_ { err = errors.New("chapterID error"); return }; _v.ChapterID = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hero"].(float64); !_ok_ { err = errors.New("hero error"); return }; _v.Hero = int32(_tempNum_) } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["chaptername"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Chaptername error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Chaptername, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } { var _ok_ bool; if _v.Chaptericon, _ok_ = _buf["chaptericon"].(string); !_ok_ { err = errors.New("chaptericon error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["onchapter"].(float64); !_ok_ { err = errors.New("onchapter error"); return }; _v.Onchapter = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["chaptertime"].(float64); !_ok_ { err = errors.New("chaptertime error"); return }; _v.Chaptertime = int32(_tempNum_) } return } func DeserializeGameHeroupstoryChaptertxtData(_buf map[string]interface{}) (*GameHeroupstoryChaptertxtData, error) { v := &GameHeroupstoryChaptertxtData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }