Beispiel #1
0
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            int numElements = Convert.ToInt32(parameters[0]);

            // read structure data
            //data_pointers = new List<ulong>();
            //for (int i = 0; i < numElements; i++)
            //{
            //    data_pointers.Add(reader.ReadUInt64());
            //}

            data_pointers = reader.ReadUlongsAt((ulong)reader.Position, (uint)numElements);


            //foreach (var dp in data_pointers)
            //{
            //    if (dp == 0)
            //    {

            //    }
            //}

            // read reference data
            //data_items = new List<T>();
            //for (int i = 0; i < numElements; i++)
            //{
            //    data_items.Add(
            //        reader.ReadBlockAt<T>(data_pointers[i])
            //        );
            //}

            data_items = new T[numElements];
            for (int i = 0; i < numElements; i++)
            {
                data_items[i] = reader.ReadStructAt <T>((long)data_pointers[i]);
            }
        }