Skip to content

Game.City.PassengerType

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

Type: public enum

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

Summary: Defines the two passenger categories used by the game for passengers: Citizen and Tourist. This enum is used wherever passenger type needs to be distinguished (transport routing, fare logic, statistics, UI display, AI behavior, etc.). The underlying numeric values are the default int values (Citizen = 0, Tourist = 1).


Fields

  • Citizen Represents a regular city resident passenger. Default underlying integer value: 0. Used to apply resident-specific rules, fares, routing preferences, or statistics.

  • Tourist Represents a tourist passenger. Default underlying integer value: 1. Tourists may be handled differently for routing, fares, destination preferences, and visitor statistics.

Properties

  • (This enum does not define properties.)

Constructors

  • (No public constructors — enums are value types and have compiler-generated constructors. Values are created by assigning the enum literal or by casting.)

Methods

  • (No methods defined on this enum type. Standard System.Enum methods are available, e.g., ToString(), Enum.Parse, Enum.GetValues, etc.)

Usage Example

// Basic usage in a switch
public int GetFareForPassenger(Game.City.PassengerType type)
{
    switch (type)
    {
        case Game.City.PassengerType.Citizen:
            return 100; // base fare for citizens
        case Game.City.PassengerType.Tourist:
            return 150; // higher fare or different pricing for tourists
        default:
            return 0;
    }
}

// Casting to int
int touristValue = (int)Game.City.PassengerType.Tourist; // 1

// Iterating all values
foreach (Game.City.PassengerType pt in Enum.GetValues(typeof(Game.City.PassengerType)))
{
    Debug.Log($"PassengerType: {pt} ({(int)pt})");
}