Game.Pathfind.AvailabilityProvider
Assembly:
Assembly-CSharp (runtime assembly for Cities: Skylines 2 mods — actual assembly name may vary depending on build)
Namespace:
Game.Pathfind
Type:
struct
Base:
System.ValueType
Summary:
Represents a simple value-type container used by the pathfinding system to describe an availability "provider" entity along with its available capacity and an associated cost. Typically used to pass lightweight provider info (entity reference, remaining capacity and cost metric) in pathfinding or resource-allocation algorithms where copying a small struct is desirable.
Fields
-
public Unity.Entities.Entity m_Provider
Entity handle identifying the provider (an ECS Entity). This is the entity that can supply capacity or service in the pathfinding/availability context. -
public System.Single m_Capacity
Available capacity provided by m_Provider. Interpreted as a numeric amount (float) that consumers in the pathfinding system can draw from. -
public System.Single m_Cost
Cost metric associated with using this provider. Lower cost typically indicates a more desirable provider; used by algorithms that weigh capacity against cost.
Properties
- None (this struct exposes public fields and does not define C# properties).
Constructors
public AvailabilityProvider(Unity.Entities.Entity provider, System.Single capacity, System.Single cost)
Initializes a new AvailabilityProvider with the specified entity, capacity and cost. Use this constructor to create instances to pass into pathfinding or availability-lookup routines.
Methods
- None (no instance or static methods defined).
Usage Example
using Unity.Entities;
using Game.Pathfind;
// Example: creating an availability provider record
Entity someProviderEntity = /* obtain or create an Entity */;
float capacity = 100f;
float cost = 1.5f;
var providerInfo = new AvailabilityProvider(someProviderEntity, capacity, cost);
// providerInfo can now be stored in arrays, NativeContainers, or passed to systems