go_dreamfactory/sys/configure/structs/game.Figure.go
2022-08-18 15:09:34 +08:00

50 lines
2.1 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 GameFigure struct {
Id int32
Key string
Color string
Val int32
PositonX int32
PositonY int32
PositonZ int32
Icon string
}
const TypeId_GameFigure = -150633376
func (*GameFigure) GetTypeId() int32 {
return -150633376
}
func (_v *GameFigure)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.Key, _ok_ = _buf["key"].(string); !_ok_ { err = errors.New("key error"); return } }
{ var _ok_ bool; if _v.Color, _ok_ = _buf["color"].(string); !_ok_ { err = errors.New("color error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["val"].(float64); !_ok_ { err = errors.New("val error"); return }; _v.Val = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["positon_x"].(float64); !_ok_ { err = errors.New("positon_x error"); return }; _v.PositonX = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["positon_y"].(float64); !_ok_ { err = errors.New("positon_y error"); return }; _v.PositonY = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["positon_z"].(float64); !_ok_ { err = errors.New("positon_z error"); return }; _v.PositonZ = int32(_tempNum_) }
{ var _ok_ bool; if _v.Icon, _ok_ = _buf["icon"].(string); !_ok_ { err = errors.New("icon error"); return } }
return
}
func DeserializeGameFigure(_buf map[string]interface{}) (*GameFigure, error) {
v := &GameFigure{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}