| | | 1 | | //======================================================================= |
| | | 2 | | // NavigationAreaPolicyCommitOperation.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 immutable navigation-area policy publication.</summary> |
| | | 11 | | public readonly struct NavigationAreaPolicyCommitOperation |
| | | 12 | | { |
| | | 13 | | /// <summary>Creates a policy publication and its pending receipt.</summary> |
| | | 14 | | public NavigationAreaPolicyCommitOperation( |
| | | 15 | | NavigationAreaPolicy policy, |
| | | 16 | | long publicationSequence, |
| | | 17 | | int effectiveFrame) |
| | | 18 | | { |
| | 198 | 19 | | SwiftThrowHelper.ThrowIfNull(policy, nameof(policy)); |
| | 198 | 20 | | NavigationOperationValidation.ValidateSchedule(publicationSequence, effectiveFrame); |
| | 198 | 21 | | Policy = policy; |
| | 198 | 22 | | PublicationSequence = publicationSequence; |
| | 198 | 23 | | EffectiveFrame = effectiveFrame; |
| | 198 | 24 | | Receipt = new NavigationOperationReceipt(publicationSequence, effectiveFrame); |
| | 198 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary>Gets the immutable policy revision.</summary> |
| | | 28 | | public NavigationAreaPolicy Policy { get; } |
| | | 29 | | |
| | | 30 | | /// <summary>Gets the unique sequence in the context's policy-publication stream.</summary> |
| | | 31 | | public long PublicationSequence { get; } |
| | | 32 | | |
| | | 33 | | /// <summary>Gets the earliest eligible fixed-step publication frame.</summary> |
| | | 34 | | public int EffectiveFrame { get; } |
| | | 35 | | |
| | | 36 | | /// <summary>Gets the operation's deterministic receipt.</summary> |
| | | 37 | | public NavigationOperationReceipt Receipt { get; } |
| | | 38 | | } |