go_dreamfactory/sys/configure/structs/Game.BlockData.go
2024-01-11 19:08:51 +08:00

77 lines
3.8 KiB
Go

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
package cfg
import "errors"
type GameBlockData struct {
Key int32
Color int32
Excolor int32
Direction []int32
Belongto int32
Open int32
Icon string
Icon2 string
Weight int32
Effect string
Choseeffect string
Pointeffect string
Score int32
Type int32
Value int32
}
const TypeId_GameBlockData = -1717313829
func (*GameBlockData) GetTypeId() int32 {
return -1717313829
}
func (_v *GameBlockData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["key"].(float64); !_ok_ { err = errors.New("key error"); return }; _v.Key = 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["excolor"].(float64); !_ok_ { err = errors.New("excolor error"); return }; _v.Excolor = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["direction"].([]interface{}); !_ok_ { err = errors.New("direction error"); return }
_v.Direction = 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.Direction = append(_v.Direction, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["belongto"].(float64); !_ok_ { err = errors.New("belongto error"); return }; _v.Belongto = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["open"].(float64); !_ok_ { err = errors.New("open error"); return }; _v.Open = int32(_tempNum_) }
{ var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } }
{ var _ok_ bool; if _v.Icon2, _ok_ = _buf["icon2"].(string); !_ok_ { err = errors.New("icon2 error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["weight"].(float64); !_ok_ { err = errors.New("weight error"); return }; _v.Weight = int32(_tempNum_) }
{ var _ok_ bool; if _v.Effect, _ok_ = _buf["effect"].(string); !_ok_ { err = errors.New("effect error"); return } }
{ var _ok_ bool; if _v.Choseeffect, _ok_ = _buf["choseeffect"].(string); !_ok_ { err = errors.New("choseeffect error"); return } }
{ var _ok_ bool; if _v.Pointeffect, _ok_ = _buf["pointeffect"].(string); !_ok_ { err = errors.New("pointeffect error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["score"].(float64); !_ok_ { err = errors.New("score error"); return }; _v.Score = 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["value"].(float64); !_ok_ { err = errors.New("value error"); return }; _v.Value = int32(_tempNum_) }
return
}
func DeserializeGameBlockData(_buf map[string]interface{}) (*GameBlockData, error) {
v := &GameBlockData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}