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

@@ -0,0 +1,33 @@
using Content.Shared.NPC;
namespace Content.Server.NPC.Pathfinding;
public sealed class GridPathfindingChunk
{
// TODO: Make this a 1d array
public readonly PathfindingBreadcrumb[,] Points = new PathfindingBreadcrumb[
(SharedPathfindingSystem.ChunkSize) * SharedPathfindingSystem.SubStep,
(SharedPathfindingSystem.ChunkSize) * SharedPathfindingSystem.SubStep];
public Vector2i Origin;
public readonly List<PathPoly>[] Polygons = new List<PathPoly>[SharedPathfindingSystem.ChunkSize * SharedPathfindingSystem.ChunkSize];
/// <summary>
/// The relevant polygon for this chunk's portals
/// </summary>
public readonly Dictionary<PathPortal, PathPoly> PortalPolys = new();
/// <summary>
/// This chunk's portals.
/// </summary>
public readonly List<PathPortal> Portals = new();
public GridPathfindingChunk()
{
for (var x = 0; x < Polygons.Length; x++)
{
Polygons[x] = new List<PathPoly>();
}
}
}