| | | 1 | | //======================================================================= |
| | | 2 | | // GridPlanarLayer.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 | | namespace GridForge.Grids.Topology; |
| | | 9 | | |
| | | 10 | | /// <summary>Identifies one selected planar layer in an exact grid generation.</summary> |
| | | 11 | | public readonly struct GridPlanarLayer |
| | | 12 | | { |
| | | 13 | | /// <summary>The exact eligible generation and committed revision.</summary> |
| | | 14 | | public GridCoveredAddressGeneration Generation { get; } |
| | | 15 | | |
| | | 16 | | /// <summary>The nonnegative topology-local layer index.</summary> |
| | | 17 | | public int LayerIndex { get; } |
| | | 18 | | |
| | | 19 | | /// <summary>Creates one explicit layer selection.</summary> |
| | | 20 | | public GridPlanarLayer(GridCoveredAddressGeneration generation, int layerIndex) |
| | | 21 | | { |
| | 264 | 22 | | ChronicleGuard.ThrowIfArgumentOutOfRange(generation.GridSpawnToken <= 0, |
| | 264 | 23 | | actualValue: null, paramName: nameof(generation)); |
| | 263 | 24 | | ChronicleGuard.ThrowIfNegative(layerIndex, nameof(layerIndex)); |
| | 262 | 25 | | Generation = generation; |
| | 262 | 26 | | LayerIndex = layerIndex; |
| | 262 | 27 | | } |
| | | 28 | | } |