| | | 1 | | //======================================================================= |
| | | 2 | | // NavigationOverlayCommitOperation.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 Trailblazer.Pathing; |
| | | 9 | | |
| | | 10 | | /// <summary>Describes one deterministic atomic overlay-transaction operation.</summary> |
| | | 11 | | public readonly struct NavigationOverlayCommitOperation |
| | | 12 | | { |
| | | 13 | | /// <summary>Initializes an immutable overlay operation and its pending receipt.</summary> |
| | | 14 | | public NavigationOverlayCommitOperation( |
| | | 15 | | PreparedNavigationOverlay preparedOverlay, |
| | | 16 | | long operationSequence, |
| | | 17 | | int effectiveFrame) |
| | | 18 | | { |
| | 286 | 19 | | SwiftThrowHelper.ThrowIfNull(preparedOverlay, nameof(preparedOverlay)); |
| | 286 | 20 | | NavigationOperationValidation.ValidateSchedule(operationSequence, effectiveFrame); |
| | | 21 | | |
| | 286 | 22 | | PreparedOverlay = preparedOverlay; |
| | 286 | 23 | | OperationSequence = operationSequence; |
| | 286 | 24 | | EffectiveFrame = effectiveFrame; |
| | 286 | 25 | | Receipt = new NavigationOperationReceipt(operationSequence, effectiveFrame); |
| | 286 | 26 | | } |
| | | 27 | | |
| | | 28 | | /// <summary>Gets the prepared immutable overlay transaction.</summary> |
| | | 29 | | public PreparedNavigationOverlay PreparedOverlay { get; } |
| | | 30 | | |
| | | 31 | | /// <summary>Gets the unique host-supplied operation sequence.</summary> |
| | | 32 | | public long OperationSequence { get; } |
| | | 33 | | |
| | | 34 | | /// <summary>Gets the earliest eligible fixed-step publication frame.</summary> |
| | | 35 | | public int EffectiveFrame { get; } |
| | | 36 | | |
| | | 37 | | /// <summary>Gets the operation's deterministic pending or terminal receipt.</summary> |
| | | 38 | | public NavigationOperationReceipt Receipt { get; } |
| | | 39 | | } |