Skip to content

Game.Prefabs.ProductionChainActorType

Assembly:
Game

Namespace: Game.Prefabs

Type:
enum

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

Summary:
Defines the different actor categories used in production chains and prefab definitions. Each member represents a logical role or sector within the game's production/logistics systems (for example Industry, Commerce, Mining). Values are sequential integers starting at 0. This enum is typically used to classify prefabs, filter actors in chain processing, and serialize/compare actor types in mod code.


Fields

  • Upkeep
    Represents upkeep-related actors (maintenance, utilities supporting other production).

  • Heating
    Actors involved in heating systems or energy input related to temperatures (e.g., heating facilities).

  • Agriculture
    Actors related to agricultural production and primary farming activities.

  • Forestry
    Actors handling forestry operations (wood production, logging).

  • Mining
    Actors for mining operations (raw mineral extraction).

  • Extraction
    Actors that extract resources other than mining (e.g., oil, water extraction).

  • Industry
    General industrial production actors (factories, heavy industry).

  • Processing
    Actors that process raw materials into intermediate goods.

  • Commerce
    Actors involved in commercial activities and wholesale trade.

  • Retail
    Actors for retail outlets and direct consumer sales.

  • Offices
    Office-sector actors (services, administrative workspaces).

  • Service
    Actors providing general services (public or private service producers).

  • Consumers
    Actors that consume goods (end users or consumer-demand representations).

Properties

  • This enum does not declare instance properties. Use standard System.Enum methods (Enum.GetValues, Enum.Parse, Enum.TryParse, etc.) for runtime inspection and conversion.

Constructors

  • Enums in C# do not declare explicit constructors. Instances are value types represented by their underlying integer values. No user-defined constructors are present.

Methods

  • The enum type itself does not declare methods. Use built-in facilities from System.Enum and typical C# operators:
  • Enum.GetValues(typeof(ProductionChainActorType))
  • Enum.GetNames(typeof(ProductionChainActorType))
  • (ProductionChainActorType)intValue to cast from int
  • intValue = (int)ProductionChainActorType.Industry
  • Enum.Parse(string) or Enum.TryParse for safe parsing

Usage Example

using Game.Prefabs;

public void HandleActor(ProductionChainActorType actorType)
{
    switch (actorType)
    {
        case ProductionChainActorType.Industry:
            // handle industry-specific logic
            break;
        case ProductionChainActorType.Retail:
            // handle retail-specific logic
            break;
        case ProductionChainActorType.Consumers:
            // handle consumer-facing logic
            break;
        default:
            // generic handling
            break;
    }
}

// Casting to/from int:
int raw = (int)ProductionChainActorType.Mining; // raw == 4
ProductionChainActorType fromInt = (ProductionChainActorType)raw;

// Parsing from string:
if (Enum.TryParse<ProductionChainActorType>("Processing", out var parsed))
{
    // use parsed
}