public static void SerializableTable(string[] valuesList, int skey, Dictionary <int, List <object> > _hash) { if ((int)_ID.MAX_RECORD != valuesList.Length) { throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Length); } Tab_Effect _values = new Tab_Effect(); _values.m_BindTargetType = Convert.ToByte(valuesList[(int)_ID.ID_BINDTARGETTYPE] as string, 10); _values.m_DelayTime = Convert.ToSingle(valuesList[(int)_ID.ID_DELAYTIME] as string); _values.m_Duration = Convert.ToSingle(valuesList[(int)_ID.ID_DURATION] as string); _values.m_EffectID = Convert.ToInt32(valuesList[(int)_ID.ID_EFFECTID] as string); _values.m_IsCanHide = Convert.ToInt16(valuesList[(int)_ID.ID_ISCANHIDE] as string) != 0; _values.m_IsFellowOwner = Convert.ToInt16(valuesList[(int)_ID.ID_ISFELLOWOWNER] as string) != 0; _values.m_IsOnlyDeactive = Convert.ToInt16(valuesList[(int)_ID.ID_ISONLYDEACTIVE] as string) != 0; _values.m_MaxOwnNum = Convert.ToInt32(valuesList[(int)_ID.ID_MAXOWNNUM] as string); _values.m_ParentName = valuesList[(int)_ID.ID_PARENTNAME] as string; _values.m_Path = valuesList[(int)_ID.ID_PATH] as string; _values.m_RotationX = Convert.ToSingle(valuesList[(int)_ID.ID_ROTATIONX] as string); _values.m_RotationY = Convert.ToSingle(valuesList[(int)_ID.ID_ROTATIONY] as string); _values.m_RotationZ = Convert.ToSingle(valuesList[(int)_ID.ID_ROTATIONZ] as string); _values.m_Type = Convert.ToByte(valuesList[(int)_ID.ID_TYPE] as string, 10); _values.m_X = Convert.ToSingle(valuesList[(int)_ID.ID_X] as string); _values.m_Y = Convert.ToSingle(valuesList[(int)_ID.ID_Y] as string); _values.m_Z = Convert.ToSingle(valuesList[(int)_ID.ID_Z] as string); if (_hash.ContainsKey(skey)) { List <object> tList = _hash[skey]; tList.Add(_values); } else { List <object> tList = new List <object>(); tList.Add(_values); _hash.Add(skey, (List <object>)tList); } }
public void SerializableTable(ArrayList valuesList, string skey, Hashtable _hash) { if (string.IsNullOrEmpty(skey)) { throw TableException.ErrorReader("Read File{0} as key is Empty Fail!!!", GetInstanceFile()); } if ((int)_ID.MAX_RECORD != valuesList.Count) { throw TableException.ErrorReader("Load {0} error as CodeSize:{1} not Equal DataSize:{2}", GetInstanceFile(), _ID.MAX_RECORD, valuesList.Count); } Int32 nKey = Convert.ToInt32(skey); Tab_Effect _values = new Tab_Effect(); _values.m_Animation = valuesList[(int)_ID.ID_ANIMATION] as string; _values.m_Describe = Convert.ToInt32(valuesList[(int)_ID.ID_DESCRIBE] as string); _values.m_Logicid = Convert.ToInt32(valuesList[(int)_ID.ID_LOGICID] as string); _values.m_Music = valuesList[(int)_ID.ID_MUSIC] as string; _values.m_Name = valuesList[(int)_ID.ID_NAME] as string; _values.m_Round = Convert.ToInt32(valuesList[(int)_ID.ID_ROUND] as string); _hash.Add(nKey, _values); }