API Vertex - shmellyorc/Box GitHub Wiki

Vertex

Namespace: Box.Pathfind

Description: Represents a node in the graph used by the A* pathfinding system. Each Vertex has a unique identifier, a 2D position, an active state, and a collection of outgoing edges to its neighbors.

Constructors

This class has no public constructors.

Properties

Name Type Description
IsActive bool Indicates whether the vertex is active and considered during pathfinding.
Id int The unique identifier of the vertex.
Position Vect2 The 2D position of the vertex in the graph.
Edges List<Edge> The list of edges connecting this vertex to its neighbor vertices.

Methods

Name Signature Description
IsConnected bool IsConnected(int id) Returns true if this vertex has an edge to the vertex with the specified ID.

Example

// Example: checking connectivity on a Vertex instance
// (in practice, Vertex instances are managed by the AStar class)
Vertex vertex = /* obtained from AStar graph */;
int neighborId = 5;
if (vertex.IsConnected(neighborId))
{
    Console.WriteLine($"Vertex {vertex.Id} is connected to {neighborId}");
}
⚠️ **GitHub.com Fallback** ⚠️