Skip to content

Game.Prefabs.TaxParameterData

Assembly:
Namespace: Game.Prefabs

Type: struct

Base: System.ValueType

Summary:
Represents a set of tax limit ranges used by the game for different zones and resource/job categories. Each field is an int2 (Unity.Mathematics) that typically encodes a min/max pair for that tax category. This struct implements IComponentData so it can be attached to ECS entities and IEquatable for value equality comparisons.


Fields

  • public int2 m_TotalTaxLimits
    Stores the min/max limits for the total tax (overall).

  • public int2 m_ResidentialTaxLimits
    Min/max tax limits for residential zones.

  • public int2 m_CommercialTaxLimits
    Min/max tax limits for commercial zones.

  • public int2 m_IndustrialTaxLimits
    Min/max tax limits for industrial zones.

  • public int2 m_OfficeTaxLimits
    Min/max tax limits for office zones.

  • public int2 m_JobLevelTaxLimits
    Min/max tax limits per job level category.

  • public int2 m_ResourceTaxLimits
    Min/max tax limits for resource-related categories.

Properties

  • None (no automatic properties defined on this struct)

Constructors

  • public TaxParameterData()
    The default parameterless struct constructor (value-initializes fields). You can also initialize the fields using an object initializer when creating an instance.

Methods

  • public bool Equals(TaxParameterData other)
    Compares this instance with another TaxParameterData by checking equality of each int2 field. The comparison checks commercial, industrial, job level, office, residential, and resource tax limits first, then total tax limits; returns true only if all corresponding int2 fields are equal.

Usage Example

using Unity.Entities;
using Unity.Mathematics;
using Game.Prefabs;

// create a TaxParameterData instance with min/max pairs
var taxParams = new TaxParameterData
{
    m_TotalTaxLimits = new int2(-20, 20),
    m_ResidentialTaxLimits = new int2(0, 15),
    m_CommercialTaxLimits = new int2(-5, 10),
    m_IndustrialTaxLimits = new int2(-10, 5),
    m_OfficeTaxLimits = new int2(0, 10),
    m_JobLevelTaxLimits = new int2(0, 5),
    m_ResourceTaxLimits = new int2(-15, 10)
};

// attach to an entity using ECS
EntityManager em = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity someEntity = em.CreateEntity();
em.AddComponentData(someEntity, taxParams);

Notes: - int2 values encode two integers (commonly used as min and max). The semantic unit (percent, absolute value, etc.) depends on the consuming game systems. - This struct is intended for use with Unity's Entities (ECS) as component data.