This commit is contained in:
liwei1dao 2022-08-12 18:59:03 +08:00
commit 6833481655
2 changed files with 97 additions and 317 deletions

View File

@ -9,8 +9,8 @@
package cfg package cfg
type GameequipColor struct { type GameequipColor struct {
_dataMap map[int32]*GameequipColorData _dataMap map[int32]*GameequipColorData
_dataList []*GameequipColorData _dataList []*GameequipColorData
} }
func NewGameequipColor(_buf []map[string]interface{}) (*GameequipColor, error) { func NewGameequipColor(_buf []map[string]interface{}) (*GameequipColor, error) {
@ -24,17 +24,19 @@ func NewGameequipColor(_buf []map[string]interface{}) (*GameequipColor, error) {
dataMap[_v.Num] = _v dataMap[_v.Num] = _v
} }
} }
return &GameequipColor{_dataList: _dataList, _dataMap: dataMap}, nil return &GameequipColor{_dataList:_dataList, _dataMap:dataMap}, nil
} }
func (table *GameequipColor) GetDataMap() map[int32]*GameequipColorData { func (table *GameequipColor) GetDataMap() map[int32]*GameequipColorData {
return table._dataMap return table._dataMap
} }
func (table *GameequipColor) GetDataList() []*GameequipColorData { func (table *GameequipColor) GetDataList() []*GameequipColorData {
return table._dataList return table._dataList
} }
func (table *GameequipColor) Get(key int32) *GameequipColorData { func (table *GameequipColor) Get(key int32) *GameequipColorData {
return table._dataMap[key] return table._dataMap[key]
} }

View File

@ -8,332 +8,110 @@
package cfg package cfg
import ( import "errors"
"errors" import "bright/serialization"
)
type GameheroData struct { type GameheroData struct {
Hid string Hid string
Name string Name string
Star int32 Star int32
Color int32 Color int32
Race int32 Race int32
Job int32 Job int32
Type int32 Type int32
Handbook int32 Handbook int32
Prefab int32 Prefab int32
Rotation string Rotation string
Icon int32 Icon int32
Vocal string Vocal string
Tujing []int32 Tujing []int32
Intr string Intr string
Events string Events string
Cite string Cite string
Effectstay []string Effectstay []string
//Hpspace serialization.Vector3 Hpspace serialization.Vector3
Skill int32 Skill int32
Skill1 int32 Skill1 int32
Skill2 int32 Skill2 int32
Skill3 int32 Skill3 int32
Txt string Txt string
Enteranivalue int32 Enteranivalue int32
Camerainterval float32 Camerainterval float32
} }
const TypeId_GameheroData = 650222912 const TypeId_GameheroData = 650222912
func (*GameheroData) GetTypeId() int32 { func (*GameheroData) GetTypeId() int32 {
return 650222912 return 650222912
} }
func (_v *GameheroData) Deserialize(_buf map[string]interface{}) (err error) { func (_v *GameheroData)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 _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 } } }
if _v.Hid, _ok_ = _buf["hid"].(string); !_ok_ { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) }
err = errors.New("hid error") { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["color"].(float64); !_ok_ { err = errors.New("color error"); return }; _v.Color = int32(_tempNum_) }
return { 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; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["handbook"].(float64); !_ok_ { err = errors.New("handbook error"); return }; _v.Handbook = int32(_tempNum_) }
var _ok_ bool { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["prefab"].(float64); !_ok_ { err = errors.New("prefab error"); return }; _v.Prefab = int32(_tempNum_) }
var __json_text__ map[string]interface{} { var _ok_ bool; if _v.Rotation, _ok_ = _buf["rotation"].(string); !_ok_ { err = errors.New("rotation error"); return } }
if __json_text__, _ok_ = _buf["name"].(map[string]interface{}); !_ok_ { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["icon"].(float64); !_ok_ { err = errors.New("icon error"); return }; _v.Icon = int32(_tempNum_) }
err = errors.New("_v.Name error") { var _ok_ bool; if _v.Vocal, _ok_ = _buf["vocal"].(string); !_ok_ { err = errors.New("vocal error"); return } }
return {
} var _arr_ []interface{}
{ var _ok_ bool
var _ok_ bool if _arr_, _ok_ = _buf["tujing"].([]interface{}); !_ok_ { err = errors.New("tujing error"); return }
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 _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
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["handbook"].(float64); !_ok_ {
err = errors.New("handbook error")
return
}
_v.Handbook = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["prefab"].(float64); !_ok_ {
err = errors.New("prefab error")
return
}
_v.Prefab = int32(_tempNum_)
}
{
var _ok_ bool
if _v.Rotation, _ok_ = _buf["rotation"].(string); !_ok_ {
err = errors.New("rotation 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
if _v.Vocal, _ok_ = _buf["vocal"].(string); !_ok_ {
err = errors.New("vocal error")
return
}
}
{
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_)) _v.Tujing = make([]int32, 0, len(_arr_))
for _, _e_ := range _arr_ { for _, _e_ := range _arr_ {
var _list_v_ int32 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_) }
var _ok_ bool _v.Tujing = append(_v.Tujing, _list_v_)
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; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["intr"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Intr error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Intr, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
var _ok_ bool { var _ok_ bool; if _v.Events, _ok_ = _buf["events"].(string); !_ok_ { err = errors.New("events error"); return } }
var __json_text__ map[string]interface{} { var _ok_ bool; if _v.Cite, _ok_ = _buf["cite"].(string); !_ok_ { err = errors.New("cite error"); return } }
if __json_text__, _ok_ = _buf["intr"].(map[string]interface{}); !_ok_ { {
err = errors.New("_v.Intr error") var _arr_ []interface{}
return var _ok_ bool
} if _arr_, _ok_ = _buf["effectstay"].([]interface{}); !_ok_ { err = errors.New("effectstay error"); return }
{
var _ok_ bool
if _, _ok_ = __json_text__["key"].(string); !_ok_ {
err = errors.New("key error")
return
}
}
{
var _ok_ bool
if _v.Intr, _ok_ = __json_text__["text"].(string); !_ok_ {
err = errors.New("text 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_)) _v.Effectstay = make([]string, 0, len(_arr_))
for _, _e_ := range _arr_ { for _, _e_ := range _arr_ {
var _list_v_ string var _list_v_ string
{ { if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
if _list_v_, _ok_ = _e_.(string); !_ok_ { _v.Effectstay = append(_v.Effectstay, _list_v_)
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 = serialization.NewVector3(_x_, _y_, _z_)
}
//_v.Hpspace = serialization.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_) }
var _ok_ bool {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["txt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Txt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Txt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
var _tempNum_ float64 { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["enteranivalue"].(float64); !_ok_ { err = errors.New("enteranivalue error"); return }; _v.Enteranivalue = int32(_tempNum_) }
if _tempNum_, _ok_ = _buf["skill"].(float64); !_ok_ { { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["camerainterval"].(float64); !_ok_ { err = errors.New("camerainterval error"); return }; _v.Camerainterval = float32(_tempNum_) }
err = errors.New("skill error") return
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_)
}
{
var _ok_ bool
var __json_text__ map[string]interface{}
if __json_text__, _ok_ = _buf["txt"].(map[string]interface{}); !_ok_ {
err = errors.New("_v.Txt error")
return
}
{
var _ok_ bool
if _, _ok_ = __json_text__["key"].(string); !_ok_ {
err = errors.New("key error")
return
}
}
{
var _ok_ bool
if _v.Txt, _ok_ = __json_text__["text"].(string); !_ok_ {
err = errors.New("text error")
return
}
}
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["enteranivalue"].(float64); !_ok_ {
err = errors.New("enteranivalue error")
return
}
_v.Enteranivalue = int32(_tempNum_)
}
{
var _ok_ bool
var _tempNum_ float64
if _tempNum_, _ok_ = _buf["camerainterval"].(float64); !_ok_ {
err = errors.New("camerainterval error")
return
}
_v.Camerainterval = float32(_tempNum_)
}
return
} }
func DeserializeGameheroData(_buf map[string]interface{}) (*GameheroData, error) { func DeserializeGameheroData(_buf map[string]interface{}) (*GameheroData, error) {
v := &GameheroData{} v := &GameheroData{}
if err := v.Deserialize(_buf); err == nil { if err := v.Deserialize(_buf); err == nil {
return v, nil return v, nil
} else { } else {
return nil, err return nil, err
} }
} }