Skip to content

Game.IncomeSource

Assembly:
(assembly inferred from project: Game)

Namespace: Game.City

Type: public enum

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

Summary: Represents the different categories/sources of income used by the city economy (taxes, service fees, exports, subsidies, etc.). Useful for indexing income arrays, reporting, logging and distributing income/expenses in game systems. The last member Count is a sentinel representing the number of defined income sources.


Fields

  • TaxResidential
    Represents income from residential taxes (housing).

  • TaxCommercial
    Represents income from commercial taxes (shops, retail).

  • TaxIndustrial
    Represents income from industrial taxes (industry and related production zones).

  • FeeHealthcare
    Income derived from healthcare-related fees or service revenue.

  • FeeElectricity
    Revenue from electricity fees (e.g., charging for power consumption or sales).

  • GovernmentSubsidy
    Income from government subsidies or grants.

  • FeeEducation
    Revenue associated with education services (school fees or related income).

  • ExportElectricity
    Income from exporting electricity to other regions/cities.

  • ExportWater
    Income from exporting water to other regions/cities.

  • FeeParking
    Revenue from parking fees.

  • FeePublicTransport
    Income from public transportation fares and related fees.

  • TaxOffice
    Tax revenue from office zones/business offices.

  • FeeGarbage
    Income from garbage collection fees or waste-management service charges.

  • FeeWater
    Revenue from water services (water supply fees).

  • Count
    Sentinel value representing the total number of income source entries. Useful for sizing arrays and iterating over all sources.

Properties

  • None specific to this enum.
    Enums do not define instance properties; use the enum members directly. The underlying integer values start at 0 and increment by 1 unless explicitly set.

Constructors

  • None (enums have implicit constructors and fixed underlying values).
    Note: Each enum member maps to an integer (starting at 0). Rely on the named members rather than numeric values.

Methods

  • None defined on this enum.
    Inherited methods from System.Enum / System.ValueType / System.Object are available (ToString, HasFlag, GetValues via Enum static methods, etc.).

Usage Example

// Example: accumulating income totals by source
decimal[] incomeBySource = new decimal[(int)Game.City.IncomeSource.Count];

// Add some income events
incomeBySource[(int)Game.City.IncomeSource.TaxResidential] += 1250.50m;
incomeBySource[(int)Game.City.IncomeSource.FeeParking] += 300.00m;
incomeBySource[(int)Game.City.IncomeSource.ExportElectricity] += 4200.00m;

// Summarize total income
decimal totalIncome = 0m;
for (int i = 0; i < (int)Game.City.IncomeSource.Count; i++)
{
    totalIncome += incomeBySource[i];
}

// Example: switch on an income source to handle UI labeling
Game.City.IncomeSource source = Game.City.IncomeSource.FeeWater;
string label = source switch
{
    Game.City.IncomeSource.TaxResidential => "Residential Tax",
    Game.City.IncomeSource.FeeWater => "Water Fees",
    Game.City.IncomeSource.ExportElectricity => "Electricity Exports",
    _ => source.ToString()
};