public override void Read(ResourceDataReader reader, params object[] parameters) { this.EntriesPointer = reader.ReadUInt64(); this.EntriesCount = reader.ReadUInt16(); this.EntriesCapacity = reader.ReadUInt16(); reader.Position += 4; //this.Entries = reader.ReadBlockAt<ResourcePointerArray64<T>>( // this.EntriesPointer, // offset // this.EntriesCount //); data_pointers = reader.ReadUlongsAt(EntriesPointer, EntriesCount); data_items = new T[EntriesCount]; for (int i = 0; i < EntriesCount; i++) { data_items[i] = reader.ReadBlockAt <T>(data_pointers[i]); } }
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]); } }