Files
tbd-station-14/Content.Server/NPC/Pathfinding/GridPathfindingComponent.cs
Pieter-Jan Briers e00f74505c Use new ComponentPauseGenerator (#25183)
Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
2024-02-26 14:36:19 +11:00

33 lines
1.1 KiB
C#

using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.NPC.Pathfinding;
/// <summary>
/// Stores the relevant pathfinding data for grids.
/// </summary>
[RegisterComponent, Access(typeof(PathfindingSystem)), AutoGenerateComponentPause]
public sealed partial class GridPathfindingComponent : Component
{
[ViewVariables]
public readonly HashSet<Vector2i> DirtyChunks = new();
/// <summary>
/// Next time the graph is allowed to update.
/// </summary>
/// Removing this datafield is the lazy fix HOWEVER I want to purge this anyway and do pathfinding at runtime.
[AutoPausedField]
public TimeSpan NextUpdate;
[ViewVariables]
public readonly Dictionary<Vector2i, GridPathfindingChunk> Chunks = new();
/// <summary>
/// Retrieves the chunk where the specified portal is stored on this grid.
/// </summary>
[ViewVariables]
public readonly Dictionary<PathPortal, Vector2i> PortalLookup = new();
[ViewVariables]
public readonly List<PathPortal> DirtyPortals = new();
}