using Content.Shared.NPC; namespace Content.Server.NPC.Pathfinding; public sealed class GridPathfindingChunk { // TODO: Make this a 1d array [ViewVariables] public readonly PathfindingBreadcrumb[,] Points = new PathfindingBreadcrumb[ (SharedPathfindingSystem.ChunkSize) * SharedPathfindingSystem.SubStep, (SharedPathfindingSystem.ChunkSize) * SharedPathfindingSystem.SubStep]; [ViewVariables] public Vector2i Origin; [ViewVariables] 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 /// [ViewVariables] public readonly Dictionary PortalPolys = new(); /// /// This chunk's portals. /// [ViewVariables] public readonly List Portals = new(); public GridPathfindingChunk() { for (var x = 0; x < Polygons.Length; x++) { Polygons[x] = new List(); BufferPolygons[x] = new List(); } } }