| | | 1 | | //======================================================================= |
| | | 2 | | // GridNavigationBodyTraceCell.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.Configuration; |
| | | 9 | | using GridForge.Spatial; |
| | | 10 | | |
| | | 11 | | namespace GridForge.Grids; |
| | | 12 | | |
| | | 13 | | /// <summary>Identifies one topology cell and its physical generation evidence.</summary> |
| | | 14 | | public readonly struct GridNavigationBodyTraceCell |
| | | 15 | | { |
| | | 16 | | /// <summary>The exact world, grid-generation, and topology-local address.</summary> |
| | | 17 | | public WorldVoxelIndex Cell { get; } |
| | | 18 | | |
| | | 19 | | /// <summary>The normalized grid binding key, independent of its recyclable runtime slot.</summary> |
| | | 20 | | public GridConfigurationKey ConfigurationKey { get; } |
| | | 21 | | |
| | | 22 | | /// <summary>Whether physical storage contained this address during the trace.</summary> |
| | | 23 | | public bool IsPhysicallyPresent { get; } |
| | | 24 | | |
| | | 25 | | /// <summary>The last committed sequence applied to the owning grid generation.</summary> |
| | | 26 | | public ulong GridLastChangeSequence { get; } |
| | | 27 | | |
| | | 28 | | /// <summary>How this identity participates in the physical coverage proof.</summary> |
| | | 29 | | public GridNavigationBodyTraceCellRole Role { get; } |
| | | 30 | | |
| | | 31 | | internal GridNavigationBodyTraceCell( |
| | | 32 | | WorldVoxelIndex cell, |
| | | 33 | | GridConfigurationKey configurationKey, |
| | | 34 | | bool isPhysicallyPresent, |
| | | 35 | | ulong gridLastChangeSequence, |
| | | 36 | | GridNavigationBodyTraceCellRole role) |
| | | 37 | | { |
| | 1605 | 38 | | Cell = cell; |
| | 1605 | 39 | | ConfigurationKey = configurationKey; |
| | 1605 | 40 | | IsPhysicallyPresent = isPhysicallyPresent; |
| | 1605 | 41 | | GridLastChangeSequence = gridLastChangeSequence; |
| | 1605 | 42 | | Role = role; |
| | 1605 | 43 | | } |
| | | 44 | | } |