diff --git a/Content.Server/NPC/Pathfinding/GridPathfindingChunk.cs b/Content.Server/NPC/Pathfinding/GridPathfindingChunk.cs index 71b82c9f7a..d3377cb071 100644 --- a/Content.Server/NPC/Pathfinding/GridPathfindingChunk.cs +++ b/Content.Server/NPC/Pathfinding/GridPathfindingChunk.cs @@ -5,12 +5,15 @@ 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]; /// @@ -21,11 +24,13 @@ public sealed class GridPathfindingChunk /// /// 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() diff --git a/Content.Server/NPC/Pathfinding/GridPathfindingComponent.cs b/Content.Server/NPC/Pathfinding/GridPathfindingComponent.cs index 2d5fe8e0c7..90a083be52 100644 --- a/Content.Server/NPC/Pathfinding/GridPathfindingComponent.cs +++ b/Content.Server/NPC/Pathfinding/GridPathfindingComponent.cs @@ -1,3 +1,5 @@ +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; + namespace Content.Server.NPC.Pathfinding; /// @@ -6,19 +8,24 @@ namespace Content.Server.NPC.Pathfinding; [RegisterComponent, Access(typeof(PathfindingSystem))] public sealed class GridPathfindingComponent : Component { + [ViewVariables] public readonly HashSet DirtyChunks = new(); /// /// Next time the graph is allowed to update. /// + [ViewVariables, DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))] public TimeSpan NextUpdate; + [ViewVariables] public readonly Dictionary Chunks = new(); /// /// Retrieves the chunk where the specified portal is stored on this grid. /// + [ViewVariables] public readonly Dictionary PortalLookup = new(); + [ViewVariables] public readonly List DirtyPortals = new(); }