//------------------------------------------------------------------------------ // // 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 GameTDWeaponData struct { Id int32 Icon string Name string Describe string Sak int32 AtkSpeed int32 WeaponType int32 BulletPrefab string FlySpeed float32 HitRange float32 HitNum int32 Num int32 ExplosionRange float32 Catapult int32 Pro int32 ExplosionEffect string } const TypeId_GameTDWeaponData = -310580526 func (*GameTDWeaponData) GetTypeId() int32 { return -310580526 } func (_v *GameTDWeaponData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["id"].(float64); !_ok_ { err = errors.New("id error"); return }; _v.Id = int32(_tempNum_) } { var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon 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 __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["describe"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Describe error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Describe, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["sak"].(float64); !_ok_ { err = errors.New("sak error"); return }; _v.Sak = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["atk_speed"].(float64); !_ok_ { err = errors.New("atk_speed error"); return }; _v.AtkSpeed = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weapon_type"].(float64); !_ok_ { err = errors.New("weapon_type error"); return }; _v.WeaponType = int32(_tempNum_) } { var _ok_ bool; if _v.BulletPrefab, _ok_ = _buf["bulletPrefab"].(string); !_ok_ { err = errors.New("bulletPrefab error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["fly_speed"].(float64); !_ok_ { err = errors.New("fly_speed error"); return }; _v.FlySpeed = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hitRange"].(float64); !_ok_ { err = errors.New("hitRange error"); return }; _v.HitRange = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hitNum"].(float64); !_ok_ { err = errors.New("hitNum error"); return }; _v.HitNum = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["num"].(float64); !_ok_ { err = errors.New("num error"); return }; _v.Num = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["explosion_Range"].(float64); !_ok_ { err = errors.New("explosion_Range error"); return }; _v.ExplosionRange = float32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["catapult"].(float64); !_ok_ { err = errors.New("catapult error"); return }; _v.Catapult = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pro"].(float64); !_ok_ { err = errors.New("pro error"); return }; _v.Pro = int32(_tempNum_) } { var _ok_ bool; if _v.ExplosionEffect, _ok_ = _buf["explosion_effect"].(string); !_ok_ { err = errors.New("explosion_effect error"); return } } return } func DeserializeGameTDWeaponData(_buf map[string]interface{}) (*GameTDWeaponData, error) { v := &GameTDWeaponData{} if err := v.Deserialize(_buf); err == nil { return v, nil } else { return nil, err } }