Skip to content

Game.Net.UtilityTypes

Assembly: Game (assembly name not provided)
Namespace: Game.Net

Type: enum (with [Flags] attribute)

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

Summary: UtilityTypes is a flagged byte-sized enumeration used to identify and combine different utility-related types in the game's networking/utility systems. Because it has the [Flags] attribute, values can be combined with bitwise operations to represent multiple utility categories at once (e.g., pipes and power lines). The enum fits in a single byte, so up to 8 independent flag values may be represented.


Fields

  • None = 0
    Represents no utility type / default state.

  • WaterPipe = 1
    Represents potable water pipes.

  • SewagePipe = 2
    Represents sewage pipes.

  • StormwaterPipe = 4
    Represents stormwater/drainage pipes.

  • LowVoltageLine = 8
    Represents low-voltage electrical distribution lines.

  • Fence = 0x10
    Represents fences (e.g., boundary or separation elements).

  • Catenary = 0x20
    Represents catenary/overhead wires (commonly for trams or trolley systems).

  • HighVoltageLine = 0x40
    Represents high-voltage transmission lines.

  • Resource = 0x80
    Represents resource-related utility flags (used for resource networks/flows).

Properties

  • This enum defines no properties. Use the enum values directly and combine them via bitwise operators or the Enum.HasFlag method. Note: the underlying type is byte, so casts may be required when converting to/from numeric types.

Constructors

  • Enums do not expose constructors in C#. There is no custom constructor for this enum; the default enum behavior applies.

Methods

  • No methods are defined on the enum itself. Use standard Enum methods (e.g., Enum.ToString, Enum.HasFlag) or bitwise operations when working with these flags.

Usage Example

// Combining flags
UtilityTypes selection = UtilityTypes.WaterPipe | UtilityTypes.LowVoltageLine;

// Checking for a specific flag (bitwise)
bool hasWater = (selection & UtilityTypes.WaterPipe) != 0;

// Checking for a specific flag (Enum.HasFlag)
bool hasFence = selection.HasFlag(UtilityTypes.Fence);

// Adding a flag
selection |= UtilityTypes.Fence;

// Removing a flag
selection &= ~UtilityTypes.LowVoltageLine;

// Casting from byte (e.g., read from serialized data)
byte raw = 0x11; // WaterPipe (0x01) + Fence (0x10)
UtilityTypes fromByte = (UtilityTypes)raw;