1
0

GridPathfindingComponent.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  2. namespace Content.Server.NPC.Pathfinding;
  3. /// <summary>
  4. /// Stores the relevant pathfinding data for grids.
  5. /// </summary>
  6. [RegisterComponent, Access(typeof(PathfindingSystem)), AutoGenerateComponentPause]
  7. public sealed partial class GridPathfindingComponent : Component
  8. {
  9. [ViewVariables]
  10. public readonly HashSet<Vector2i> DirtyChunks = new();
  11. /// <summary>
  12. /// Next time the graph is allowed to update.
  13. /// </summary>
  14. /// Removing this datafield is the lazy fix HOWEVER I want to purge this anyway and do pathfinding at runtime.
  15. [AutoPausedField]
  16. public TimeSpan NextUpdate;
  17. [ViewVariables]
  18. public readonly Dictionary<Vector2i, GridPathfindingChunk> Chunks = new();
  19. /// <summary>
  20. /// Retrieves the chunk where the specified portal is stored on this grid.
  21. /// </summary>
  22. [ViewVariables]
  23. public readonly Dictionary<PathPortal, Vector2i> PortalLookup = new();
  24. [ViewVariables]
  25. public readonly List<PathPortal> DirtyPortals = new();
  26. }