//------------------------------------------------------------------------------
// <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 GameSkillAfteratkData struct {
    Id int32
    EmitPR int32
    From int32
    Where []string
    Order string
    Limit int32
    ExecuteCnt int32
    Type int32
    Argu []int32
    FollowSK []int32
    SucFollowSK []int32
    FailFollowSK []int32
    MustHit bool
    DpsRevisiType int32
    DpsCondition string
    RevisiCondition string
    RevisiParams []int32
}

const TypeId_GameSkillAfteratkData = -281122053

func (*GameSkillAfteratkData) GetTypeId() int32 {
    return -281122053
}

func (_v *GameSkillAfteratkData)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["EmitPR"].(float64); !_ok_ { err = errors.New("EmitPR error"); return }; _v.EmitPR = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["From"].(float64); !_ok_ { err = errors.New("From error"); return }; _v.From = int32(_tempNum_) }
     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["Where"].([]interface{}); !_ok_ { err = errors.New("Where error"); return }

                _v.Where = make([]string, 0, len(_arr_))
                
                for _, _e_ := range _arr_ {
                    var _list_v_ string
                    {  if _list_v_, _ok_ = _e_.(string); !_ok_ { err = errors.New("_list_v_ error"); return } }
                    _v.Where = append(_v.Where, _list_v_)
                }
            }

    { var _ok_ bool; if _v.Order, _ok_ = _buf["Order"].(string); !_ok_ { err = errors.New("Order error"); return } }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["Limit"].(float64); !_ok_ { err = errors.New("Limit error"); return }; _v.Limit = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["ExecuteCnt"].(float64); !_ok_ { err = errors.New("ExecuteCnt error"); return }; _v.ExecuteCnt = 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 _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["Argu"].([]interface{}); !_ok_ { err = errors.New("Argu error"); return }

                _v.Argu = 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.Argu = append(_v.Argu, _list_v_)
                }
            }

     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["FollowSK"].([]interface{}); !_ok_ { err = errors.New("FollowSK error"); return }

                _v.FollowSK = 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.FollowSK = append(_v.FollowSK, _list_v_)
                }
            }

     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["SucFollowSK"].([]interface{}); !_ok_ { err = errors.New("SucFollowSK error"); return }

                _v.SucFollowSK = 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.SucFollowSK = append(_v.SucFollowSK, _list_v_)
                }
            }

     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["FailFollowSK"].([]interface{}); !_ok_ { err = errors.New("FailFollowSK error"); return }

                _v.FailFollowSK = 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.FailFollowSK = append(_v.FailFollowSK, _list_v_)
                }
            }

    { var _ok_ bool; if _v.MustHit, _ok_ = _buf["MustHit"].(bool); !_ok_ { err = errors.New("MustHit error"); return } }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["DpsRevisiType"].(float64); !_ok_ { err = errors.New("DpsRevisiType error"); return }; _v.DpsRevisiType = int32(_tempNum_) }
    { var _ok_ bool; if _v.DpsCondition, _ok_ = _buf["DpsCondition"].(string); !_ok_ { err = errors.New("DpsCondition error"); return } }
    { var _ok_ bool; if _v.RevisiCondition, _ok_ = _buf["RevisiCondition"].(string); !_ok_ { err = errors.New("RevisiCondition error"); return } }
     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["RevisiParams"].([]interface{}); !_ok_ { err = errors.New("RevisiParams error"); return }

                _v.RevisiParams = 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.RevisiParams = append(_v.RevisiParams, _list_v_)
                }
            }

    return
}

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