//------------------------------------------------------------------------------ // // 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" import "bright/math" type Game_newHeroData struct { Hid int32 Name string Star int32 Color int32 Race int32 Job int32 Type int32 Prefab string Icon int32 Sound int32 Tujing []int32 Intr string Events string Cite string Effectstay []string Hpspace math.Vector3 Skill int32 Skill1 int32 Skill2 int32 Skill3 int32 } func (Game_newHeroData) GetTypeId() int { return -1696809848 } func NewGame_newHeroData(_buf map[string]interface{}) (_v *Game_newHeroData, err error) { _v = &Game_newHeroData{} { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hid"].(float64); !_ok_ { err = errors.New("hid error"); return }; _v.Hid = int32(_tempNum_) } { var _ok_ bool; if _v.Name, _ok_ = _buf["name"].(string); !_ok_ { err = errors.New("name 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 _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["race"].(float64); !_ok_ { err = errors.New("race error"); return }; _v.Race = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["job"].(float64); !_ok_ { err = errors.New("job error"); return }; _v.Job = 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; if _v.Prefab, _ok_ = _buf["prefab"].(string); !_ok_ { err = errors.New("prefab error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["icon"].(float64); !_ok_ { err = errors.New("icon error"); return }; _v.Icon = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["sound"].(float64); !_ok_ { err = errors.New("sound error"); return }; _v.Sound = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["tujing"].([]interface{}); !_ok_ { err = errors.New("tujing error"); return } _v.Tujing = 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.Tujing = append(_v.Tujing, _list_v_) } } { var _ok_ bool; if _v.Intr, _ok_ = _buf["intr"].(string); !_ok_ { err = errors.New("intr error"); return } } { var _ok_ bool; if _v.Events, _ok_ = _buf["events"].(string); !_ok_ { err = errors.New("events error"); return } } { var _ok_ bool; if _v.Cite, _ok_ = _buf["cite"].(string); !_ok_ { err = errors.New("cite error"); return } } { var _arr_ []interface{} var _ok_ bool if _arr_, _ok_ = _buf["effectstay"].([]interface{}); !_ok_ { err = errors.New("effectstay error"); return } _v.Effectstay = 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.Effectstay = append(_v.Effectstay, _list_v_) } } { var _ok_ bool; var _v_ map[string]interface{}; if _v_, _ok_ = _buf["hpspace"].(map[string]interface{}); !_ok_ { err = errors.New("hpspace error"); return } var _x_, _y_, _z_ float32; { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["x"].(float64); !_ok_ { err = errors.New("x error"); return }; _x_ = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["y"].(float64); !_ok_ { err = errors.New("y error"); return }; _y_ = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _v_["z"].(float64); !_ok_ { err = errors.New("z error"); return }; _z_ = float32(_tempNum_) } _v.Hpspace = math.NewVector3(_x_, _y_, _z_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill"].(float64); !_ok_ { err = errors.New("skill error"); return }; _v.Skill = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill1"].(float64); !_ok_ { err = errors.New("skill1 error"); return }; _v.Skill1 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill2"].(float64); !_ok_ { err = errors.New("skill2 error"); return }; _v.Skill2 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["skill3"].(float64); !_ok_ { err = errors.New("skill3 error"); return }; _v.Skill3 = int32(_tempNum_) } return }