| | | 1 | | //======================================================================= |
| | | 2 | | // GridTraceSlab.cs |
| | | 3 | | //======================================================================= |
| | | 4 | | // MIT License, Copyright (c) 2024-present David Oravsky (mrdav30) |
| | | 5 | | // See LICENSE file in the project root for full license information. |
| | | 6 | | //======================================================================= |
| | | 7 | | |
| | | 8 | | using GridForge.Grids.Topology; |
| | | 9 | | |
| | | 10 | | namespace GridForge.Grids; |
| | | 11 | | |
| | | 12 | | /// <summary>Describes one completed X slab of an original rectangular segment trace.</summary> |
| | | 13 | | public readonly struct GridTraceSlab |
| | | 14 | | { |
| | | 15 | | /// <summary>The topology-local X index.</summary> |
| | | 16 | | public int XIndex { get; } |
| | | 17 | | /// <summary>The first newly appended interval.</summary> |
| | | 18 | | public int IntervalStart { get; } |
| | | 19 | | /// <summary>The number of newly appended intervals, possibly zero.</summary> |
| | | 20 | | public int IntervalCount { get; } |
| | | 21 | | /// <summary>Whether the original endpoints strictly straddle the slab with a one-raw-parameter margin.</summary> |
| | | 22 | | public bool SeparatesEndpoints { get; } |
| | | 23 | | /// <summary>The captured world allocation identity.</summary> |
| | | 24 | | public long WorldSpawnToken { get; } |
| | | 25 | | /// <summary>The original world change sequence, captured before generation qualification.</summary> |
| | | 26 | | public ulong WorldChangeSequence { get; } |
| | | 27 | | /// <summary>The exact qualified grid generation.</summary> |
| | | 28 | | public GridCoveredAddressGeneration Generation { get; } |
| | | 29 | | |
| | | 30 | | internal GridTraceSlab(int xIndex, int intervalStart, int intervalCount, bool separatesEndpoints, |
| | | 31 | | long worldSpawnToken, ulong worldChangeSequence, GridCoveredAddressGeneration generation) |
| | | 32 | | { |
| | 177 | 33 | | XIndex = xIndex; |
| | 177 | 34 | | IntervalStart = intervalStart; |
| | 177 | 35 | | IntervalCount = intervalCount; |
| | 177 | 36 | | SeparatesEndpoints = separatesEndpoints; |
| | 177 | 37 | | WorldSpawnToken = worldSpawnToken; |
| | 177 | 38 | | WorldChangeSequence = worldChangeSequence; |
| | 177 | 39 | | Generation = generation; |
| | 177 | 40 | | } |
| | | 41 | | } |