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