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[] Polygons = new List[SharedPathfindingSystem.ChunkSize * SharedPathfindingSystem.ChunkSize]; /// /// Store the recalculated polygons to know what needs changing. /// internal readonly List[] BufferPolygons = new List[SharedPathfindingSystem.ChunkSize * SharedPathfindingSystem.ChunkSize]; /// /// The relevant polygon for this chunk's portals /// public readonly Dictionary PortalPolys = new(); /// /// This chunk's portals. /// public readonly List Portals = new(); public GridPathfindingChunk() { for (var x = 0; x < Polygons.Length; x++) { Polygons[x] = new List(); BufferPolygons[x] = new List(); } } }