Skip to content

Game.Prefabs.ServiceFeeParameterData

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

Type: struct

Base: IComponentData, IQueryTypeParameter

Summary:
Holds fee-related parameters for a prefab's services (electricity, healthcare, education levels, garbage, water, fire response, police). Exposes accessors to retrieve FeeParameters for a specific PlayerResource and to enumerate default ServiceFee values based on each configured parameter. Commonly used as an ECS component on prefab archetypes to store service fee configuration.


Fields

  • public FeeParameters m_ElectricityFee
    Stores fee parameters for electricity service (includes default fee, ranges, etc. as defined by FeeParameters).

  • public AnimationCurve1 m_ElectricityFeeConsumptionMultiplier
    Curve used to modify electricity consumption based on fee (an AnimationCurve-like structure).

  • public FeeParameters m_HealthcareFee
    Fee parameters for healthcare service.

  • public FeeParameters m_BasicEducationFee
    Fee parameters for basic education service.

  • public FeeParameters m_SecondaryEducationFee
    Fee parameters for secondary education service.

  • public FeeParameters m_HigherEducationFee
    Fee parameters for higher education service.

  • public FeeParameters m_GarbageFee
    Fee parameters for garbage collection service.

  • public int4 m_GarbageFeeRCIO
    An int4 likely encoding RCIO (Residential/Commercial/Industrial/Office) multipliers or flags for garbage fees per land-use category.

  • public FeeParameters m_WaterFee
    Fee parameters for water service.

  • public AnimationCurve1 m_WaterFeeConsumptionMultiplier
    Curve used to modify water consumption based on fee.

  • public FeeParameters m_FireResponseFee
    Fee parameters for fire response service.

  • public FeeParameters m_PoliceFee
    Fee parameters for police service.

Properties

  • This type does not declare any C# properties. It exposes its data via public fields and methods.

Constructors

  • public ServiceFeeParameterData()
    Default (compiler-provided) value-type constructor. Initializes fields to their default values (e.g., struct fields zeroed/null). Use object initializer to set specific fee parameters when constructing.

Methods

  • public FeeParameters GetFeeParameters(PlayerResource resource)
    Returns the FeeParameters corresponding to the provided PlayerResource enum value. Supported resources: Healthcare, Electricity, BasicEducation, HigherEducation, SecondaryEducation, Garbage, Water, FireResponse, Police. If an unsupported resource is passed, returns default(FeeParameters).

  • public IEnumerable<ServiceFee> GetDefaultFees()
    Yields a sequence of ServiceFee entries representing the default fee for each supported PlayerResource. Each yielded ServiceFee contains m_Resource and m_Fee set to that resource's configured default (FeeParameters.m_Default).

  • private ServiceFee GetDefaultServiceFee(PlayerResource resource)
    Helper that constructs a ServiceFee for the given resource using GetFeeParameters(resource).m_Default as the fee value.

Usage Example

// Retrieve fee parameters for a prefab component (example usage context)
ServiceFeeParameterData feeData = new ServiceFeeParameterData
{
    m_ElectricityFee = new FeeParameters { m_Default = 10 },
    m_WaterFee = new FeeParameters { m_Default = 5 },
    // set other fields as needed...
};

// Get FeeParameters for electricity
FeeParameters electricityParams = feeData.GetFeeParameters(PlayerResource.Electricity);

// Iterate default service fees
foreach (ServiceFee sf in feeData.GetDefaultFees())
{
    Debug.Log($"Resource: {sf.m_Resource}, DefaultFee: {sf.m_Fee}");
}