示例#1
0
        protected void _Load <T>(XQFileStream file, XQHashtable hash, Action <T, ushort> action) where T : IStaticDataBase, new()
        {
            hash.Clear();

            ushort usNumber = 0;

            file.ReadUShort(ref usNumber);
            for (ushort i = 0; i < usNumber; i++)
            {
                T info = new T();
                info.Load(file);
                if (action != null)
                {
                    action(info, i);
                }
                if (!hash.ContainsKey(info.ID))
                {
                    if (info.ID != 0)
                    {
                        hash.Add(info.ID, info);
                    }
                }
                else
                {
                    Debug.LogError(info.GetType() + " Has SameKey : " + info.ID);
                }
            }
        }
示例#2
0
 protected void _Load <T>(XQFileStream file, XQHashtable hash) where T : IStaticDataBase, new()
 {
     _Load <T>(file, hash, null);
 }