Skip to content

Game.Pathfind.SetupQueueTarget

Assembly: Assembly-CSharp.dll
Namespace: Game.Pathfind

Type: struct

Base: System.ValueType

Summary:
Represents a single target entry used by the pathfinding setup queue. This plain data struct carries all information needed by pathfinding systems to enqueue and evaluate a target: what kind of target it is, which entities or resources are involved, constraints such as allowed activities or transport types, and several numeric parameters used as costs, radii, counts or other modifiers. It's intended to be used inside ECS systems and jobified pathfinding code (so fields are blittable and lightweight).


Fields

  • public SetupTargetType m_Type
    Identifies the kind of setup target (for example: building, vehicle, resource node, maintenance target). Determines how the pathfinder should interpret the rest of the fields.

  • public PathMethod m_Methods
    Flags or enum indicating which pathfinding methods or modes are applicable (for example walking, driving, public transport routing, freight). Used to filter/select pathfinding algorithms or network types.

  • public Entity m_Entity
    Primary ECS Entity associated with this target (for example the requester or the destination building). Typically an Entity from Unity.Entities.

  • public Entity m_Entity2
    Secondary ECS Entity associated with the target (optional). Used when two-entity context is required (for example source and target building, vehicle and target, etc).

  • public Resource m_Resource
    If this target refers to a resource (goods, service, item), this field specifies which resource type is relevant.

  • public ActivityMask m_ActivityMask
    Bitmask describing allowed or required activities for the target (e.g., types of cargo handling, service activities, or worker activities). Used to constrain pathfinding to compatible actors.

  • public MaintenanceType m_MaintenanceType
    If the target relates to maintenance tasks, this specifies the maintenance category (for example repair, clean, upgrade). Helps route specialized maintenance vehicles/workers.

  • public SetupTargetFlags m_Flags
    Additional flags that modify target behavior (priority, optional/mandatory, special handling). Implementation-defined flags used by enqueue/dequeue logic.

  • public TrackTypes m_TrackTypes
    Specifies rail/track types relevant to the target (if applicable). Used by pathfinding to match vehicles or networks to compatible track types.

  • public RoadTypes m_RoadTypes
    Specifies allowed road types for ground routing to this target (car lanes, bus lanes, highways, etc).

  • public RoadTypes m_FlyingTypes
    Specifies allowed aerial/bridge/flying road types (used for flying vehicles or elevated links).

  • public int m_Value
    Generic integer parameter. Commonly used for things like priority, count of required units, or an ID/offset depending on context.

  • public float m_Value2
    Generic float parameter. Often used for costs, radii, timeouts, or distance thresholds.

  • public float m_RandomCost
    Small random cost added to the pathfinding evaluation to break ties or introduce variability in route selection.

  • public int m_Value3
    Another generic integer parameter for additional contextual data (could be lane index, building level, required capacity, etc).

Properties

  • None (this is a plain data struct with public fields).

Constructors

  • public SetupQueueTarget()
    Default parameterless constructor provided by the C# compiler for structs. All fields will be default-initialized (numeric fields = 0, enums = 0, Entities = Entity.Null, etc). Users typically construct and then assign relevant fields.

Methods

  • None (no methods are declared on this struct).

Usage Example

// Create and initialize a SetupQueueTarget to request a path to a delivery target
var target = new SetupQueueTarget
{
    m_Type = SetupTargetType.Delivery,        // example enum value
    m_Methods = PathMethod.Road | PathMethod.Pedestrian,
    m_Entity = deliveryBuildingEntity,
    m_Resource = Resource.Goods,
    m_ActivityMask = ActivityMask.Load | ActivityMask.Unload,
    m_RoadTypes = RoadTypes.Car | RoadTypes.Bus,
    m_Value = 1,              // e.g. required units
    m_Value2 = 50.0f,         // e.g. search radius
    m_RandomCost = UnityEngine.Random.value * 0.01f
};

// Enqueue into the pathfinding setup queue (pseudocode)
// PathfindSetupQueue.Enqueue(target);

Notes: - This struct is meant to be lightweight and used in job-friendly contexts. Avoid adding managed references or non-blittable fields. - Field meanings for m_Value / m_Value2 / m_Value3 are context-dependent; consult calling code or systems that enqueue SetupQueueTarget entries to learn specific semantics.