| | | 1 | | //======================================================================= |
| | | 2 | | // TrailblazerNavigationService.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 System; |
| | | 9 | | using Trailblazer.Navigation.MovementGroups; |
| | | 10 | | |
| | | 11 | | namespace Trailblazer.Navigation; |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Context-owned navigation coordination state for navigators, steering, movement groups, and ids. |
| | | 15 | | /// </summary> |
| | | 16 | | internal sealed class TrailblazerNavigationService |
| | | 17 | | { |
| | 989 | 18 | | internal TrailblazerNavigationService(TrailblazerWorldContext context) |
| | | 19 | | { |
| | 989 | 20 | | MovementGroups = new MovementGroupCoordinatorState(context); |
| | 989 | 21 | | NavigatorIds = new NavigatorGlobalIdAllocatorState(); |
| | 989 | 22 | | } |
| | | 23 | | |
| | | 24 | | internal MovementGroupCoordinatorState MovementGroups { get; } |
| | | 25 | | |
| | | 26 | | internal NavigatorGlobalIdAllocatorState NavigatorIds { get; } |
| | | 27 | | |
| | 265 | 28 | | internal Guid CreateNavigatorId() => NavigatorIds.Create(); |
| | | 29 | | |
| | | 30 | | internal void Reset() |
| | | 31 | | { |
| | 22 | 32 | | MovementGroups.Reset(); |
| | 22 | 33 | | NavigatorIds.Reset(); |
| | 22 | 34 | | } |
| | | 35 | | } |