go_dreamfactory/sys/configure/structs/Game.CaravanThingData.go
2023-07-04 17:16:49 +08:00

121 lines
5.4 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 GameCaravanThingData struct {
Itemid string
Goodsprice int32
Changeperiod []int32
PriceChangeWeight []int32
PriceChangeWeightOne []int32
PriceChangeWeightTwo []int32
PriceChangeWeightThree []int32
FluctuationRange int32
Pricemin int32
Pricemax int32
Goodsnum int32
}
const TypeId_GameCaravanThingData = 638455774
func (*GameCaravanThingData) GetTypeId() int32 {
return 638455774
}
func (_v *GameCaravanThingData)Deserialize(_buf map[string]interface{}) (err error) {
{ var _ok_ bool; if _v.Itemid, _ok_ = _buf["itemid"].(string); !_ok_ { err = errors.New("itemid error"); return } }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["goodsprice"].(float64); !_ok_ { err = errors.New("goodsprice error"); return }; _v.Goodsprice = int32(_tempNum_) }
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["changeperiod"].([]interface{}); !_ok_ { err = errors.New("changeperiod error"); return }
_v.Changeperiod = 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.Changeperiod = append(_v.Changeperiod, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["PriceChangeWeight"].([]interface{}); !_ok_ { err = errors.New("PriceChangeWeight error"); return }
_v.PriceChangeWeight = 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.PriceChangeWeight = append(_v.PriceChangeWeight, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["PriceChangeWeight_one"].([]interface{}); !_ok_ { err = errors.New("PriceChangeWeight_one error"); return }
_v.PriceChangeWeightOne = 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.PriceChangeWeightOne = append(_v.PriceChangeWeightOne, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["PriceChangeWeight_two"].([]interface{}); !_ok_ { err = errors.New("PriceChangeWeight_two error"); return }
_v.PriceChangeWeightTwo = 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.PriceChangeWeightTwo = append(_v.PriceChangeWeightTwo, _list_v_)
}
}
{
var _arr_ []interface{}
var _ok_ bool
if _arr_, _ok_ = _buf["PriceChangeWeight_three"].([]interface{}); !_ok_ { err = errors.New("PriceChangeWeight_three error"); return }
_v.PriceChangeWeightThree = 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.PriceChangeWeightThree = append(_v.PriceChangeWeightThree, _list_v_)
}
}
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["FluctuationRange"].(float64); !_ok_ { err = errors.New("FluctuationRange error"); return }; _v.FluctuationRange = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pricemin"].(float64); !_ok_ { err = errors.New("pricemin error"); return }; _v.Pricemin = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["pricemax"].(float64); !_ok_ { err = errors.New("pricemax error"); return }; _v.Pricemax = int32(_tempNum_) }
{ var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["goodsnum"].(float64); !_ok_ { err = errors.New("goodsnum error"); return }; _v.Goodsnum = int32(_tempNum_) }
return
}
func DeserializeGameCaravanThingData(_buf map[string]interface{}) (*GameCaravanThingData, error) {
v := &GameCaravanThingData{}
if err := v.Deserialize(_buf); err == nil {
return v, nil
} else {
return nil, err
}
}