Skip to content

Game.PathfindSetupTarget

Assembly:
Game (assembly not explicitly specified in source file)

Namespace:
Game.Simulation

Type:
struct

Base:
System.ValueType

Summary:
Struct used to pair a PathTarget (the pathfinding destination description) with an integer setup index. Instances of this struct are used during pathfinding setup/dispatch phases to keep together the destination data and an associated index (for example an index into a setup buffer, job array, or to preserve ordering). The PathTarget type referenced by m_PathTarget is declared in Game.Pathfind.


Fields

  • public Game.Pathfind.PathTarget m_PathTarget
    Holds the destination information used by the pathfinder (position, lane/node references, flags, etc.). This field is the main payload of the struct and is expected to be copied or read by pathfinding setup logic and jobs. See Game.Pathfind.PathTarget for the shape and meaning of this value.

  • public int m_SetupIndex
    An integer index used during pathfind setup. Typical uses include an index into per-target setup arrays, an identifier for the originating request, or a slot index used when batching multiple targets for processing. The exact semantics depend on the surrounding pathfinding system code that consumes PathfindSetupTarget.

Properties

  • This type does not declare any properties. It exposes its data via public fields for simple value-type usage and efficient copying.

Constructors

  • public PathfindSetupTarget()
    Structs in C# have an implicit parameterless default constructor which zero-initializes fields. There is no custom constructor declared in the source file; create and initialize instances with object initializers or by assigning fields directly.

Methods

  • This type does not declare any methods.

Usage Example

using Game.Pathfind;
using Game.Simulation;

// Create and initialize a PathfindSetupTarget
PathfindSetupTarget target = new PathfindSetupTarget
{
    m_PathTarget = new PathTarget
    {
        // set PathTarget fields here (example properties)
        // position = somePosition,
        // laneId = someLaneId,
        // flags = PathTargetFlags.None
    },
    m_SetupIndex = 0 // index into whatever setup/buffer system is used
};

// Pass to the pathfinding setup/dispatcher (example, actual API will vary)
pathfindDispatcher.EnqueueSetupTarget(target);

Remarks: - Being a value type (struct) makes PathfindSetupTarget cheap to copy, which is useful when batching targets for jobs or multi-threaded pathfinding. - Consult Game.Pathfind.PathTarget to understand the fields that need to be populated for correct pathfinding behavior.