//------------------------------------------------------------------------------
// <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 GameSkillBuffData struct {
    Id int32
    Name string
    Desc string
    BuffType int32
    EffectArgu []int32
    BufParNum int32
    RelyCheckArgu []int32
    CoexistCheckArgu []int32
    Effect []int32
    AddEffect bool
    RemoveType bool
    NotOverlay int32
    OverlayTimes byte
    SameID bool
    Golbalbufficon string
    BuffIcon string
    Buffeffect string
    Buffpos string
}

const TypeId_GameSkillBuffData = 198132498

func (*GameSkillBuffData) GetTypeId() int32 {
    return 198132498
}

func (_v *GameSkillBuffData)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 __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["Name"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Name error"); return };  { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Name, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
    {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["Desc"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Desc error"); return };  { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Desc, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BuffType"].(float64); !_ok_ { err = errors.New("BuffType error"); return }; _v.BuffType = int32(_tempNum_) }
     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["EffectArgu"].([]interface{}); !_ok_ { err = errors.New("EffectArgu error"); return }

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

    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["BufParNum"].(float64); !_ok_ { err = errors.New("BufParNum error"); return }; _v.BufParNum = int32(_tempNum_) }
     {
                var _arr_ []interface{}
                var _ok_ bool
                if _arr_, _ok_ = _buf["RelyCheckArgu"].([]interface{}); !_ok_ { err = errors.New("RelyCheckArgu error"); return }

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

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

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

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

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

    { var _ok_ bool; if _v.AddEffect, _ok_ = _buf["AddEffect"].(bool); !_ok_ { err = errors.New("AddEffect error"); return } }
    { var _ok_ bool; if _v.RemoveType, _ok_ = _buf["RemoveType"].(bool); !_ok_ { err = errors.New("RemoveType error"); return } }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["NotOverlay"].(float64); !_ok_ { err = errors.New("NotOverlay error"); return }; _v.NotOverlay = int32(_tempNum_) }
    { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["OverlayTimes"].(float64); !_ok_ { err = errors.New("OverlayTimes error"); return }; _v.OverlayTimes = byte(_tempNum_) }
    { var _ok_ bool; if _v.SameID, _ok_ = _buf["SameID"].(bool); !_ok_ { err = errors.New("SameID error"); return } }
    { var _ok_ bool; if _v.Golbalbufficon, _ok_ = _buf["golbalbufficon"].(string); !_ok_ { err = errors.New("golbalbufficon error"); return } }
    { var _ok_ bool; if _v.BuffIcon, _ok_ = _buf["buffIcon"].(string); !_ok_ { err = errors.New("buffIcon error"); return } }
    { var _ok_ bool; if _v.Buffeffect, _ok_ = _buf["buffeffect"].(string); !_ok_ { err = errors.New("buffeffect error"); return } }
    { var _ok_ bool; if _v.Buffpos, _ok_ = _buf["buffpos"].(string); !_ok_ { err = errors.New("buffpos error"); return } }
    return
}

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