Pathfinder rework (#11452)

This commit is contained in:
metalgearsloth
2022-09-30 14:39:48 +10:00
committed by GitHub
parent fd3b29fb03
commit f456ad911e
80 changed files with 3606 additions and 4374 deletions

View File

@@ -1,8 +1,24 @@
namespace Content.Server.NPC.Pathfinding;
[RegisterComponent]
[Access(typeof(PathfindingSystem))]
/// <summary>
/// Stores the relevant pathfinding data for grids.
/// </summary>
[RegisterComponent, Access(typeof(PathfindingSystem))]
public sealed class GridPathfindingComponent : Component
{
public readonly Dictionary<Vector2i, PathfindingChunk> Graph = new();
public readonly HashSet<Vector2i> DirtyChunks = new();
/// <summary>
/// Next time the graph is allowed to update.
/// </summary>
public TimeSpan NextUpdate;
public readonly Dictionary<Vector2i, GridPathfindingChunk> Chunks = new();
/// <summary>
/// Retrieves the chunk where the specified portal is stored on this grid.
/// </summary>
public readonly Dictionary<PathPortal, Vector2i> PortalLookup = new();
public readonly List<PathPortal> DirtyPortals = new();
}