Pathfinder rework (#11452)

This commit is contained in:
metalgearsloth
2022-09-30 14:39:48 +10:00
committed by GitHub
parent fd3b29fb03
commit f456ad911e
80 changed files with 3606 additions and 4374 deletions

View File

@@ -0,0 +1,32 @@
using Robust.Shared.Map;
using Robust.Shared.Serialization;
namespace Content.Shared.NPC;
/*
* I bikeshedded a lot on how to do this and I'm still not entirely happy.
* The main thing is you need a weak ref to the poly because it may be invalidated due to graph updates.
* I had a struct version but you still need to store the neighbors somewhere, maybe on the chunk itself?
* Future dev work required.
*/
/// <summary>
/// A path poly to be used for networked debug purposes.
/// </summary>
[Serializable, NetSerializable]
public sealed class DebugPathPoly
{
public EntityUid GraphUid;
public Vector2i ChunkOrigin;
public byte TileIndex;
public Box2 Box;
public PathfindingData Data;
public List<EntityCoordinates> Neighbors = default!;
}
[Serializable, NetSerializable]
public sealed class DebugPathPolyNeighbor
{
public EntityCoordinates Coordinates;
}