Game.Pathfind.PathfindTargetSeekerData
Assembly: Assembly-CSharp (game runtime assembly)
Namespace: Game.Pathfind
Type: struct
Base: System.ValueType
Summary:
PathfindTargetSeekerData is a lightweight data container used by pathfinding systems to gather read-only access to many entity components and buffers required when searching for or evaluating pathfinding targets. It centralizes ComponentLookup and BufferLookup references (all created as read-only) and carries AirwayHelpers.AirwayData used by aerial pathfinding. The struct is constructed from a SystemBase and must be updated each frame (or whenever the SystemBase changes) via Update(...) to refresh the internal lookups.
Fields
-
public AirwayHelpers.AirwayData m_AirwayData
Holds airway (aircraft navigation) data used for aircraft pathfinding. Initialized to default in the constructor and updated via Update(...). -
public ComponentLookup<Owner> m_Owner
Read-only lookup for Owner component. -
public ComponentLookup<Transform> m_Transform
Read-only lookup for Transform component. -
public ComponentLookup<Attached> m_Attached
Read-only lookup for Attached component. -
public ComponentLookup<Game.Objects.SpawnLocation> m_SpawnLocation
Read-only lookup for SpawnLocation components. -
public ComponentLookup<Stopped> m_Stopped
Read-only lookup for Stopped component (entity is stopped). -
public ComponentLookup<HumanCurrentLane> m_HumanCurrentLane
Read-only lookup for human (pedestrian) current lane component. -
public ComponentLookup<CarCurrentLane> m_CarCurrentLane
Read-only lookup for car current lane component. -
public ComponentLookup<TrainCurrentLane> m_TrainCurrentLane
Read-only lookup for train current lane component. -
public ComponentLookup<WatercraftCurrentLane> m_WatercraftCurrentLane
Read-only lookup for watercraft current lane component. -
public ComponentLookup<AircraftCurrentLane> m_AircraftCurrentLane
Read-only lookup for aircraft current lane component. -
public ComponentLookup<ParkedCar> m_ParkedCar
Read-only lookup for parked car marker component. -
public ComponentLookup<ParkedTrain> m_ParkedTrain
Read-only lookup for parked train marker component. -
public ComponentLookup<Train> m_Train
Read-only lookup for Train component. -
public ComponentLookup<Airplane> m_Airplane
Read-only lookup for Airplane component. -
public ComponentLookup<Building> m_Building
Read-only lookup for Building component. -
public ComponentLookup<PropertyRenter> m_PropertyRenter
Read-only lookup for PropertyRenter component. -
public ComponentLookup<CurrentBuilding> m_CurrentBuilding
Read-only lookup for CurrentBuilding component. -
public ComponentLookup<CurrentTransport> m_CurrentTransport
Read-only lookup for CurrentTransport component. -
public ComponentLookup<Curve> m_Curve
Read-only lookup for curve geometry component used by lanes/roads. -
public ComponentLookup<Game.Net.PedestrianLane> m_PedestrianLane
Read-only lookup for pedestrian lane definitions. -
public ComponentLookup<Game.Net.ParkingLane> m_ParkingLane
Read-only lookup for parking lane definitions. -
public ComponentLookup<Game.Net.CarLane> m_CarLane
Read-only lookup for car lane definitions. -
public ComponentLookup<MasterLane> m_MasterLane
Read-only lookup for MasterLane component. -
public ComponentLookup<SlaveLane> m_SlaveLane
Read-only lookup for SlaveLane component. -
public ComponentLookup<Game.Net.ConnectionLane> m_ConnectionLane
Read-only lookup for connection lane component. -
public ComponentLookup<NodeLane> m_NodeLane
Read-only lookup for NodeLane component. -
public ComponentLookup<LaneConnection> m_LaneConnection
Read-only lookup for lane connection metadata. -
public ComponentLookup<RouteLane> m_RouteLane
Read-only lookup for route lane component used by routing. -
public ComponentLookup<AccessLane> m_AccessLane
Read-only lookup for access lane component. -
public ComponentLookup<PrefabRef> m_PrefabRef
Read-only lookup to get prefab references for entities. -
public ComponentLookup<BuildingData> m_BuildingData
Read-only lookup for building-specific data. -
public ComponentLookup<PathfindCarData> m_CarPathfindData
Read-only lookup for car-specific pathfinding data. -
public ComponentLookup<SpawnLocationData> m_SpawnLocationData
Read-only lookup for spawn location metadata. -
public ComponentLookup<NetLaneData> m_NetLaneData
Read-only lookup for shared net lane data. -
public ComponentLookup<CarLaneData> m_CarLaneData
Read-only lookup for car lane data. -
public ComponentLookup<ParkingLaneData> m_ParkingLaneData
Read-only lookup for parking lane data. -
public ComponentLookup<TrackLaneData> m_TrackLaneData
Read-only lookup for track/rail lane data. -
public BufferLookup<Game.Net.SubLane> m_SubLane
Read-only buffer lookup for sub-lanes belonging to a lane entity. -
public BufferLookup<Game.Areas.Node> m_AreaNode
Read-only buffer lookup for area node elements (area navigation). -
public BufferLookup<Triangle> m_AreaTriangle
Read-only buffer lookup for area triangles used in area navigation meshes. -
public BufferLookup<SpawnLocationElement> m_SpawnLocations
Read-only buffer lookup containing spawn location elements for spawn entities. -
public BufferLookup<LayoutElement> m_VehicleLayout
Read-only buffer lookup for vehicle layout (used by vehicles/convoys). -
public BufferLookup<CarNavigationLane> m_CarNavigationLanes
Read-only buffer lookup for car navigation lane sequences. -
public BufferLookup<WatercraftNavigationLane> m_WatercraftNavigationLanes
Read-only buffer lookup for watercraft navigation lanes. -
public BufferLookup<AircraftNavigationLane> m_AircraftNavigationLanes
Read-only buffer lookup for aircraft navigation lanes.
All ComponentLookup and BufferLookup fields are created with isReadOnly = true in the constructor.
Properties
- None (this struct exposes only public fields).
Constructors
public PathfindTargetSeekerData(SystemBase system)
Initializes all ComponentLookup and BufferLookup fields by requesting read-only lookups from the provided SystemBase. m_AirwayData is set to its default state. Use this constructor when creating an instance inside a SystemBase (e.g., in OnCreate or OnStartRunning).
Methods
public void Update(SystemBase system, AirwayHelpers.AirwayData airwayData)
: System.Void
Refreshes the stored AirwayData and calls Update(system) on every ComponentLookup and BufferLookup so they remain valid for the current system execution context. Call this at the start of a system update (or before using the lookups) to ensure lookups are synchronized with the SystemBase.
Usage Example
// Inside a SystemBase
private PathfindTargetSeekerData _seekerData;
private AirwayHelpers.AirwayData _airwayData; // obtained from some airway helper
protected override void OnCreate()
{
base.OnCreate();
_seekerData = new PathfindTargetSeekerData(this);
}
protected override void OnUpdate()
{
// update airway data from game helper before updating seeker data
_airwayData = AirwayHelpers.GetAirwayData(/* ... */);
_seekerData.Update(this, _airwayData);
// Now use _seekerData.m_CarLane, _seekerData.m_CarNavigationLanes, etc. in queries/jobs
}
Notes: - All lookups are read-only to prevent accidental writes; to write components you'd need writable ComponentLookup instances. - Update(...) must be called when the SystemBase context changes (each frame or whenever required) to avoid stale lookups.