//------------------------------------------------------------------------------
// <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 GameLotteryData struct {
    Id int32
    Lotteryid int32
    Description string
    Type int32
    Groupwt int32
    Groupid int32
    Subtype int32
    Groupnum int32
    Itemid *Gameatn
    Itemdes string
    Itemwt int32
    Min int32
    Max int32
    VIPmin int32
    VIPmax int32
    Playerlvmin int32
    Playerlvmax int32
    Notice int32
}

const TypeId_GameLotteryData = 1267925655

func (*GameLotteryData) GetTypeId() int32 {
    return 1267925655
}

func (_v *GameLotteryData)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; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["lotteryid"].(float64); !_ok_ { err = errors.New("lotteryid error"); return }; _v.Lotteryid = int32(_tempNum_) }
    { var _ok_ bool; if _v.Description, _ok_ = _buf["description"].(string); !_ok_ { err = errors.New("description error"); return } }
    { 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["groupwt"].(float64); !_ok_ { err = errors.New("groupwt error"); return }; _v.Groupwt = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["groupid"].(float64); !_ok_ { err = errors.New("groupid error"); return }; _v.Groupid = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["subtype"].(float64); !_ok_ { err = errors.New("subtype error"); return }; _v.Subtype = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["groupnum"].(float64); !_ok_ { err = errors.New("groupnum error"); return }; _v.Groupnum = int32(_tempNum_) }
    { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _buf["itemid"].(map[string]interface{}); !_ok_ { err = errors.New("itemid error"); return }; if _v.Itemid, err = DeserializeGameatn(_x_); err != nil { return } }
    { var _ok_ bool; if _v.Itemdes, _ok_ = _buf["itemdes"].(string); !_ok_ { err = errors.New("itemdes error"); return } }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["itemwt"].(float64); !_ok_ { err = errors.New("itemwt error"); return }; _v.Itemwt = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["min"].(float64); !_ok_ { err = errors.New("min error"); return }; _v.Min = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["max"].(float64); !_ok_ { err = errors.New("max error"); return }; _v.Max = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["VIPmin"].(float64); !_ok_ { err = errors.New("VIPmin error"); return }; _v.VIPmin = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["VIPmax"].(float64); !_ok_ { err = errors.New("VIPmax error"); return }; _v.VIPmax = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["playerlvmin"].(float64); !_ok_ { err = errors.New("playerlvmin error"); return }; _v.Playerlvmin = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["playerlvmax"].(float64); !_ok_ { err = errors.New("playerlvmax error"); return }; _v.Playerlvmax = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["notice"].(float64); !_ok_ { err = errors.New("notice error"); return }; _v.Notice = int32(_tempNum_) }
    return
}

func DeserializeGameLotteryData(_buf map[string]interface{}) (*GameLotteryData, error) {
    v := &GameLotteryData{}
    if err := v.Deserialize(_buf); err == nil {
        return v, nil
    } else {
        return nil, err
    }
}
