Пример #1
0
        /// <summary>
        /// Parses the _data field into the array of LumpItems
        /// </summary>
        private void ReadData()
        {
            using var ms     = new MemoryStream(DataBytes);
            using var reader = new BinaryReader(ms);

            // Load game lump headers and data
            var lumpCount = reader.ReadInt32();

            _offsets  = new int[lumpCount];
            LumpItems = new List <GameLumpItem>(lumpCount);
            for (var i = 0; i < lumpCount; i++)
            {
                var lumpItem = GameLumpItem.FromStream(reader, Offset);
                _offsets[i] = lumpItem.Offset ?? 0;
                LumpItems.Add(lumpItem);
            }
        }
Пример #2
0
 public bool Equals(GameLumpItem item)
 {
     return item.ID == ID && item.Flags == Flags && item.Version == Version && item.Data.SequenceEqual(Data);
 }