//------------------------------------------------------------------------------
// <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 GameDrawCardData struct {
    Key int32
    RecruitmentType int32
    CardPoolType string
    Star int32
    Rece int32
    Id string
    Weight int32
}

const TypeId_GameDrawCardData = -371601222

func (*GameDrawCardData) GetTypeId() int32 {
    return -371601222
}

func (_v *GameDrawCardData)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["recruitment_type"].(float64); !_ok_ { err = errors.New("recruitment_type error"); return }; _v.RecruitmentType = int32(_tempNum_) }
    { var _ok_ bool; if _v.CardPoolType, _ok_ = _buf["card_pool_type"].(string); !_ok_ { err = errors.New("card_pool_type 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["rece"].(float64); !_ok_ { err = errors.New("rece error"); return }; _v.Rece = int32(_tempNum_) }
    { var _ok_ bool; if _v.Id, _ok_ = _buf["id"].(string); !_ok_ { err = errors.New("id 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_) }
    return
}

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