src/AnvilPacker/Level/RegionReader.cs
/// <summary> Enumerates the raw data of all chunks in this region. </summary>
/// <remarks> The yielded ArraySegment is only valid until the next iteration, or the next call made in this instance. </remarks>
Enumerates the raw data of all chunks in this region.
Enumerates the raw data of all chunks in this region .
public IEnumerable<(ArraySegment<byte> TagData, int X, int Z)> ReadAllData()
        {
            foreach (var (loc, i) in _locations.Select((v, i) => (v, i)).OrderBy(e => e.v)) {
                if (IsValidLocation(loc)) {
                    var data = ReadData(loc);
                    yield return (data, i & 31, i >> 5);
                }
            }
        }
public IEnumerable < ( ArraySegment < byte > TagData , int X , int Z ) > ReadAllData ( ) { foreach ( var ( loc , i ) in _locations . Select ( ( v , i ) => ( v , i ) ) . OrderBy ( e => e . v ) ) { if ( IsValidLocation ( loc ) ) { var data = ReadData ( loc ) ; yield return ( data , i & 31 , i >> 5 ) ; } } }
Enumerates the raw data of all chunks in this region.
Enumerates the raw data of all chunks in this region .
remarks
The yielded ArraySegment is only valid until the next iteration, or the next call made in this instance.
The yielded ArraySegment is only valid until the next iteration or the next call made in this instance .