Show / Hide Table of Contents

Class PathfindingSystem

This system handles pathfinding graph updates as well as dispatches to the pathfinder (90% of what it's doing is graph updates so not much point splitting the 2 roles)

Inheritance
System.Object
SharedPathfindingSystem
PathfindingSystem
Namespace: Content.Server.NPC.Pathfinding
Assembly: Content.Server.dll
Syntax
public sealed class PathfindingSystem : SharedPathfindingSystem

Fields

| Improve this Doc View Source

PathfindingCollisionLayer

Declaration
public const int PathfindingCollisionLayer = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PathfindingCollisionMask

Declaration
public const int PathfindingCollisionMask = null
Field Value
Type Description
System.Int32
| Improve this Doc View Source

PauseUpdating

If true, UpdateGrid() will not process grids.

Declaration
public bool PauseUpdating
Field Value
Type Description
System.Boolean
Remarks

Useful if something like a large explosion is in the process of shredding the grid, as it avoids unneccesary updating.

Methods

| Improve this Doc View Source

EuclideanDistance(PathPoly, PathPoly)

Declaration
public float EuclideanDistance(PathPoly start, PathPoly end)
Parameters
Type Name Description
PathPoly start
PathPoly end
Returns
Type Description
System.Single
| Improve this Doc View Source

GetFlags(NPCBlackboard)

Declaration
public PathFlags GetFlags(NPCBlackboard blackboard)
Parameters
Type Name Description
NPCBlackboard blackboard
Returns
Type Description
PathFlags
| Improve this Doc View Source

GetFlags(EntityUid)

Declaration
public PathFlags GetFlags(EntityUid uid)
Parameters
Type Name Description
EntityUid uid
Returns
Type Description
PathFlags
| Improve this Doc View Source

GetPath(EntityUid, EntityUid, Single, CancellationToken, PathFlags)

Declaration
public Task<PathResultEvent> GetPath(EntityUid entity, EntityUid target, float range, CancellationToken cancelToken, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
EntityUid entity
EntityUid target
System.Single range
CancellationToken cancelToken
PathFlags flags
Returns
Type Description
Task<PathResultEvent>
| Improve this Doc View Source

GetPath(EntityUid, EntityCoordinates, EntityCoordinates, Single, CancellationToken, PathFlags)

Declaration
public Task<PathResultEvent> GetPath(EntityUid entity, EntityCoordinates start, EntityCoordinates end, float range, CancellationToken cancelToken, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
EntityUid entity
Robust.Shared.Map.EntityCoordinates start
Robust.Shared.Map.EntityCoordinates end
System.Single range
CancellationToken cancelToken
PathFlags flags
Returns
Type Description
Task<PathResultEvent>
| Improve this Doc View Source

GetPath(EntityCoordinates, EntityCoordinates, Single, Int32, Int32, CancellationToken, PathFlags)

Asynchronously gets a path.

Declaration
public Task<PathResultEvent> GetPath(EntityCoordinates start, EntityCoordinates end, float range, int layer, int mask, CancellationToken cancelToken, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
Robust.Shared.Map.EntityCoordinates start
Robust.Shared.Map.EntityCoordinates end
System.Single range
System.Int32 layer
System.Int32 mask
CancellationToken cancelToken
PathFlags flags
Returns
Type Description
Task<PathResultEvent>
| Improve this Doc View Source

GetPath(Vector2i, Vector2i, Boolean)

Finds a generic path from start to end.

Declaration
public List<Vector2i> GetPath(Vector2i start, Vector2i end, bool diagonal = false)
Parameters
Type Name Description
Vector2i start
Vector2i end
System.Boolean diagonal
Returns
Type Description
List<Vector2i>
| Improve this Doc View Source

GetPathDistance(EntityUid, EntityCoordinates, Single, CancellationToken, PathFlags)

Gets the estimated distance from the entity to the target node.

Declaration
public Task<float?> GetPathDistance(EntityUid entity, EntityCoordinates end, float range, CancellationToken cancelToken, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
EntityUid entity
Robust.Shared.Map.EntityCoordinates end
System.Single range
CancellationToken cancelToken
PathFlags flags
Returns
Type Description
Task<System.Nullable<System.Single>>
| Improve this Doc View Source

GetPathEvent(EntityUid, EntityCoordinates, EntityCoordinates, Single, CancellationToken, PathFlags)

Raises the pathfinding result event on the entity when finished.

Declaration
public void GetPathEvent(EntityUid uid, EntityCoordinates start, EntityCoordinates end, float range, CancellationToken cancelToken, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
EntityUid uid
Robust.Shared.Map.EntityCoordinates start
Robust.Shared.Map.EntityCoordinates end
System.Single range
CancellationToken cancelToken
PathFlags flags
| Improve this Doc View Source

GetPathSafe(EntityUid, EntityCoordinates, EntityCoordinates, Single, CancellationToken, PathFlags)

Gets a path in a thread-safe way.

Declaration
public Task<PathResultEvent> GetPathSafe(EntityUid entity, EntityCoordinates start, EntityCoordinates end, float range, CancellationToken cancelToken, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
EntityUid entity
Robust.Shared.Map.EntityCoordinates start
Robust.Shared.Map.EntityCoordinates end
System.Single range
CancellationToken cancelToken
PathFlags flags
Returns
Type Description
Task<PathResultEvent>
| Improve this Doc View Source

GetPoly(EntityCoordinates)

Gets the relevant poly for the specified coordinates if it exists.

Declaration
public PathPoly GetPoly(EntityCoordinates coordinates)
Parameters
Type Name Description
Robust.Shared.Map.EntityCoordinates coordinates
Returns
Type Description
PathPoly
| Improve this Doc View Source

GetRandomPath(EntityUid, Single, CancellationToken, Int32, PathFlags)

Declaration
public Task<PathResultEvent> GetRandomPath(EntityUid entity, float maxRange, CancellationToken cancelToken, int limit = 40, PathFlags flags = default(PathFlags))
Parameters
Type Name Description
EntityUid entity
System.Single maxRange
CancellationToken cancelToken
System.Int32 limit
PathFlags flags
Returns
Type Description
Task<PathResultEvent>
| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

ManhattanDistance(PathPoly, PathPoly)

Declaration
public float ManhattanDistance(PathPoly start, PathPoly end)
Parameters
Type Name Description
PathPoly start
PathPoly end
Returns
Type Description
System.Single
| Improve this Doc View Source

OctileDistance(PathPoly, PathPoly)

Declaration
public float OctileDistance(PathPoly start, PathPoly end)
Parameters
Type Name Description
PathPoly start
PathPoly end
Returns
Type Description
System.Single
| Improve this Doc View Source

RemovePortal(Int32)

Declaration
public bool RemovePortal(int handle)
Parameters
Type Name Description
System.Int32 handle
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Shutdown()

Declaration
public override void Shutdown()
| Improve this Doc View Source

Simplify(List<PathPoly>, Single)

Declaration
public List<PathPoly> Simplify(List<PathPoly> vertices, float tolerance = null)
Parameters
Type Name Description
List<PathPoly> vertices
System.Single tolerance
Returns
Type Description
List<PathPoly>
| Improve this Doc View Source

TryCreatePortal(EntityCoordinates, EntityCoordinates, out Int32)

Creates neighbouring edges at both locations, each leading to the other.

Declaration
public bool TryCreatePortal(EntityCoordinates coordsA, EntityCoordinates coordsB, out int handle)
Parameters
Type Name Description
Robust.Shared.Map.EntityCoordinates coordsA
Robust.Shared.Map.EntityCoordinates coordsB
System.Int32 handle
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Update(Single)

Declaration
public override void Update(float frameTime)
Parameters
Type Name Description
System.Single frameTime
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾