Skip to content

Game.Pathfind.PathfindHeuristicData

Assembly: Assembly-CSharp
Namespace: Game.Pathfind

Type: struct

Base: System.ValueType

Summary:
Container of heuristic pathfinding cost sets for different agent/transport types used by the game's pathfinding system. Each field holds a PathfindCosts value that encodes cost heuristics for a particular travel mode (cars, tracks, pedestrians, flying units, off‑road vehicles, taxis). This struct is a plain value type intended to be passed into pathfinding routines to provide mode-specific heuristic information.


Fields

  • public PathfindCosts m_CarCosts
    Heuristic costs used for car pathfinding (automobiles and road vehicles).

  • public PathfindCosts m_TrackCosts
    Heuristic costs used for track-based vehicles (trains, trams, or other guided rail vehicles).

  • public PathfindCosts m_PedestrianCosts
    Heuristic costs used for pedestrian pathfinding (walking agents).

  • public PathfindCosts m_FlyingCosts
    Heuristic costs used for flying agents (helicopters, planes, drones).

  • public PathfindCosts m_OffRoadCosts
    Heuristic costs used for off‑road capable vehicles (vehicles that can travel off paved roads).

  • public PathfindCosts m_TaxiCosts
    Heuristic costs used specifically for taxi routing/agents.

Properties

  • None. This struct exposes raw public fields and does not define properties.

Constructors

  • public PathfindHeuristicData()
    Implicit default parameterless constructor provided by the C# compiler. All fields are initialized to default(PathfindCosts). If PathfindCosts is a struct, its default values will be used; initialize fields explicitly when non-default heuristics are required.

Methods

  • None. The struct contains only fields and no instance methods.

Usage Example

// Create and initialize heuristic data for various travel modes.
var heuristicData = new Game.Pathfind.PathfindHeuristicData
{
    m_CarCosts = new PathfindCosts { /* set car heuristics */ },
    m_TrackCosts = new PathfindCosts { /* set rail heuristics */ },
    m_PedestrianCosts = new PathfindCosts { /* set walking heuristics */ },
    m_FlyingCosts = new PathfindCosts { /* set flying heuristics */ },
    m_OffRoadCosts = new PathfindCosts { /* set off-road heuristics */ },
    m_TaxiCosts = new PathfindCosts { /* set taxi heuristics */ }
};

// Example: passing the struct to a pathfinder call (pseudo-code)
pathfinder.SetHeuristics(heuristicData.m_CarCosts);

Additional notes: - Because this is a value type, copying PathfindHeuristicData copies all contained PathfindCosts. If PathfindCosts is large, prefer passing the struct by reference (ref) to avoid unnecessary allocations/copies in performance-sensitive code. - Initialize fields explicitly to avoid relying on defaults if specific heuristics are required for accurate routing.