Add VV to gridpathfinding comp (#13081)
This commit is contained in:
@@ -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<PathPoly>[] Polygons = new List<PathPoly>[SharedPathfindingSystem.ChunkSize * SharedPathfindingSystem.ChunkSize];
|
||||
|
||||
/// <summary>
|
||||
@@ -21,11 +24,13 @@ public sealed class GridPathfindingChunk
|
||||
/// <summary>
|
||||
/// The relevant polygon for this chunk's portals
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public readonly Dictionary<PathPortal, PathPoly> PortalPolys = new();
|
||||
|
||||
/// <summary>
|
||||
/// This chunk's portals.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public readonly List<PathPortal> Portals = new();
|
||||
|
||||
public GridPathfindingChunk()
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.NPC.Pathfinding;
|
||||
|
||||
/// <summary>
|
||||
@@ -6,19 +8,24 @@ namespace Content.Server.NPC.Pathfinding;
|
||||
[RegisterComponent, Access(typeof(PathfindingSystem))]
|
||||
public sealed class GridPathfindingComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
public readonly HashSet<Vector2i> DirtyChunks = new();
|
||||
|
||||
/// <summary>
|
||||
/// Next time the graph is allowed to update.
|
||||
/// </summary>
|
||||
[ViewVariables, DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
public TimeSpan NextUpdate;
|
||||
|
||||
[ViewVariables]
|
||||
public readonly Dictionary<Vector2i, GridPathfindingChunk> Chunks = new();
|
||||
|
||||
/// <summary>
|
||||
/// Retrieves the chunk where the specified portal is stored on this grid.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
public readonly Dictionary<PathPortal, Vector2i> PortalLookup = new();
|
||||
|
||||
[ViewVariables]
|
||||
public readonly List<PathPortal> DirtyPortals = new();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user