//------------------------------------------------------------------------------ // // 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 Game_shopData struct { Shopid int32 Tab int32 Shopname string UpperShop string Needshow []*Game_atn Rtype int32 Rtime int32 Rnum int32 Rneed []*Game_atn Shopitem []int32 } func (Game_shopData) GetTypeId() int { return 923847228 } func NewGame_shopData(_buf map[string]interface{}) (_v *Game_shopData, err error) { _v = &Game_shopData{} { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["shopid"].(float64); !_ok_ { err = errors.New("shopid error"); return }; _v.Shopid = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["tab"].(float64); !_ok_ { err = errors.New("tab error"); return }; _v.Tab = int32(_tempNum_) } { var _ok_ bool; if _v.Shopname, _ok_ = _buf["shopname"].(string); !_ok_ { err = errors.New("shopname error"); return } } { var _ok_ bool; if _v.UpperShop, _ok_ = _buf["upper_shop"].(string); !_ok_ { err = errors.New("upper_shop error"); return } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["needshow"].([]interface{}); !_ok_ { err = errors.New("needshow error"); return } _v.Needshow = make([]*Game_atn, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ *Game_atn { 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 = NewGame_atn(_x_); err != nil { return } } _v.Needshow = append(_v.Needshow, _list_v_) } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rtype"].(float64); !_ok_ { err = errors.New("rtype error"); return }; _v.Rtype = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rtime"].(float64); !_ok_ { err = errors.New("rtime error"); return }; _v.Rtime = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["rnum"].(float64); !_ok_ { err = errors.New("rnum error"); return }; _v.Rnum = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["rneed"].([]interface{}); !_ok_ { err = errors.New("rneed error"); return } _v.Rneed = make([]*Game_atn, 0, len(_arr_)) for _, _e_ := range _arr_ { var _list_v_ *Game_atn { 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 = NewGame_atn(_x_); err != nil { return } } _v.Rneed = append(_v.Rneed, _list_v_) } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["shopitem"].([]interface{}); !_ok_ { err = errors.New("shopitem error"); return } _v.Shopitem = 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.Shopitem = append(_v.Shopitem, _list_v_) } } return }