Skip to content

Game.Prefabs.OutsideConnectionTransferType

Assembly: Assembly-CSharp
Namespace: Game.Prefabs

Type: public enum

Base: System.Enum

Summary:
Represents the types of outside connection transfer modes used by prefabs/entities for connecting to the outside world. Marked with [Flags] so multiple transfer types can be combined as a bitmask. Values include common transport modes (Road, Train, Air, Ship) plus None and a Last sentinel. Note: there is a gap in the bit values (0x8 is unused), so the values are not strictly contiguous.


Fields

  • None = 0
    Represents no transfer type / default value.

  • Road = 1
    Represents road-based connections (bit 0).

  • Train = 2
    Represents rail/train-based connections (bit 1).

  • Air = 4
    Represents air-based connections (bit 2).

  • Ship = 0x10
    Represents ship/sea-based connections (bit 4, decimal 16). (Bit 3 / 0x8 is intentionally not used here.)

  • Last = 0x20
    Sentinel/marker value (bit 5, decimal 32). Often used as an upper bound or reserved flag.

Properties

  • This enum type does not declare any properties. It is a simple flag enum with named constant fields.

Constructors

  • Enums in C# do not define explicit constructors in source; underlying values are provided by the compiler. You can cast numeric values to this enum type (for example: (OutsideConnectionTransferType)0x11).

Methods

  • This enum does not declare any instance or static methods. Use standard enum operations and helpers (bitwise operators, Enum.HasFlag, Enum.ToString, casting, parsing).

Usage Example

// Combine flags
OutsideConnectionTransferType combination = OutsideConnectionTransferType.Road | OutsideConnectionTransferType.Train;

// Check flags (preferred: bitwise & for performance in hot code)
bool hasRoad = (combination & OutsideConnectionTransferType.Road) != 0;
// Or use HasFlag (slower)
bool hasTrain = combination.HasFlag(OutsideConnectionTransferType.Train);

// Set a flag
combination |= OutsideConnectionTransferType.Air;

// Clear a flag
combination &= ~OutsideConnectionTransferType.Train;

// Parse from integer
OutsideConnectionTransferType fromInt = (OutsideConnectionTransferType)0x11; // Road (1) + Ship (0x10)

// Iterate active flags
foreach (OutsideConnectionTransferType flag in Enum.GetValues(typeof(OutsideConnectionTransferType)))
{
    if (flag != OutsideConnectionTransferType.None && (combination & flag) != 0)
    {
        // handle active flag
    }
}