Skip to content

Game.City.TaxRate

Assembly: Game (in-game assembly; exact DLL may vary by build)
Namespace: Game.City

Type: public enum

Base: System.Enum (underlying type: System.Int32)

Summary: TaxRate is an enumeration used to identify different tax categories and offsets within the city's taxation system. Members represent the primary tax category (Main), per-zone offsets (Residential, Commercial, Industrial, Office), special-case offsets (education or resource-related zero-tax categories), and a Count value used as a sentinel/array-size indicator. These enum values are typically used as indices into tax tables, arrays of modifiers, or to select behavior in tax-calculation logic.


Fields

  • Main = 0
    Represents the base/default tax category. Often used as the primary tax value from which other offsets are applied.

  • ResidentialOffset = 1
    Offset type for residential zone tax adjustments (applied relative to Main).

  • CommercialOffset = 2
    Offset type for commercial zone tax adjustments.

  • IndustrialOffset = 3
    Offset type for industrial zone tax adjustments.

  • OfficeOffset = 4
    Offset type for office zone tax adjustments.

  • EducationZeroOffset = 5
    Special offset used for education-related tax rules (e.g., policies that zero or alter taxes for education purposes).

  • CommercialResourceZeroOffset = 10
    Special commercial resource-related zero/override offset. Likely used when commercial resource production/consumption needs a specific tax adjustment.

  • IndustrialResourceZeroOffset = 51
    Special industrial resource-related zero/override offset. Similar purpose as CommercialResourceZeroOffset but for industrial resources.

  • Count = 92
    Sentinel value indicating the count or size of the tax rate table/enum space. Commonly used to size arrays or validate indices. Note that numerical value is larger than the number of explicitly listed constants and may reserve space for additional enum members or indexed ranges in the game's implementation.

Properties

  • This enum defines no properties. Use standard System.Enum methods (ToString, HasFlag, etc.) when needed.

Constructors

  • Enums do not define explicit constructors. Instances are created by assigning one of the named constants (e.g., TaxRate.Main).

Methods

  • This enum defines no custom methods. You can use the usual System.Enum helper methods:
  • ToString() — get the name of the enum value.
  • Enum.IsDefined(typeof(TaxRate), value) — check if an integer maps to a defined member.
  • Cast/convert via (int)rate to get the underlying integer value.

Usage Example

// Read and use a tax rate enum as an index into a modifier array
float[] taxModifiers = new float[(int)TaxRate.Count]; // sized by Count sentinel

// set base tax modifier
taxModifiers[(int)TaxRate.Main] = 1.0f;

// apply residential offset
taxModifiers[(int)TaxRate.ResidentialOffset] = 0.9f; // 10% lower for example

// selecting behavior based on tax category
TaxRate current = TaxRate.ResidentialOffset;
switch (current)
{
    case TaxRate.Main:
        // handle base tax
        break;
    case TaxRate.ResidentialOffset:
        // apply residential-specific logic
        break;
    case TaxRate.CommercialOffset:
        // ...
        break;
    default:
        // fallback or policy handling
        break;
}

// converting from an int (e.g., stored index) to enum safely
int storedIndex = 1;
if (Enum.IsDefined(typeof(TaxRate), storedIndex))
{
    TaxRate rate = (TaxRate)storedIndex;
    // use rate...
}
else
{
    // handle out-of-range index
}