| | | 1 | | //======================================================================= |
| | | 2 | | // NavigationMapRemoveOperation.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 map-and-overlay removal operation.</summary> |
| | | 11 | | public readonly struct NavigationMapRemoveOperation |
| | | 12 | | { |
| | | 13 | | /// <summary>Initializes an immutable map-removal operation and its pending receipt.</summary> |
| | | 14 | | public NavigationMapRemoveOperation(string mapId, long operationSequence, int effectiveFrame) |
| | | 15 | | { |
| | 22 | 16 | | SwiftThrowHelper.ThrowIfNull(mapId, nameof(mapId)); |
| | 22 | 17 | | SwiftThrowHelper.ThrowIfArgument(string.IsNullOrWhiteSpace(mapId), nameof(mapId)); |
| | 22 | 18 | | NavigationOperationValidation.ValidateSchedule(operationSequence, effectiveFrame); |
| | | 19 | | |
| | 22 | 20 | | MapId = mapId; |
| | 22 | 21 | | OperationSequence = operationSequence; |
| | 22 | 22 | | EffectiveFrame = effectiveFrame; |
| | 22 | 23 | | Receipt = new NavigationOperationReceipt(operationSequence, effectiveFrame); |
| | 22 | 24 | | } |
| | | 25 | | |
| | | 26 | | /// <summary>Gets the stable map identifier to remove.</summary> |
| | | 27 | | public string MapId { get; } |
| | | 28 | | |
| | | 29 | | /// <summary>Gets the unique host-supplied operation sequence.</summary> |
| | | 30 | | public long OperationSequence { get; } |
| | | 31 | | |
| | | 32 | | /// <summary>Gets the earliest eligible fixed-step publication frame.</summary> |
| | | 33 | | public int EffectiveFrame { get; } |
| | | 34 | | |
| | | 35 | | /// <summary>Gets the operation's deterministic pending or terminal receipt.</summary> |
| | | 36 | | public NavigationOperationReceipt Receipt { get; } |
| | | 37 | | } |