Skip to content

Game.Companies.StorageTransferFlags

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

Type: public enum

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

Summary: Flags enum used by the company/transfer systems to indicate transport modes and transfer direction for storage/transfer operations. The [Flags] attribute allows combinations of these values to represent multiple transport types or directions at once (for example, a transfer that is both Track-based and Incoming).


Fields

  • Car = 1 Used to mark transfers or storage operations that involve road vehicles / personal cars.

  • Transport = 2 Represents public transport or non-car transport types (buses, trams, etc.) as a classification for a transfer.

  • Track = 4 Indicates transfers that use track-based infrastructure (rail, metro, etc.).

  • Incoming = 8 Marks the transfer as incoming (goods/people/materials arriving), as opposed to outgoing.

Properties

  • This enum defines no custom properties. Standard System.Enum behavior and API apply (e.g., ToString(), GetValues(), HasFlag via Enum.HasFlag or bitwise checks).

Constructors

  • Enums do not expose custom constructors in C#. Instances are created by assigning one of the enum values or a combination of values (bitwise).

Methods

  • No custom methods are defined on this enum. Use bitwise operators or Enum.HasFlag to work with combined flags. Example operations: bitwise OR to combine, AND to test, bitwise NOT/XOR to toggle/remove.

Usage Example

// Combine multiple flags
StorageTransferFlags flags = StorageTransferFlags.Car | StorageTransferFlags.Incoming;

// Check for a specific flag (bitwise)
bool isCar = (flags & StorageTransferFlags.Car) != 0;

// Or use Enum.HasFlag (slower but readable)
bool isIncoming = flags.HasFlag(StorageTransferFlags.Incoming);

// Add a flag
flags |= StorageTransferFlags.Transport;

// Remove a flag
flags &= ~StorageTransferFlags.Car;

// Toggle a flag
flags ^= StorageTransferFlags.Track;

// Typical check before handling a transfer
if ((flags & StorageTransferFlags.Track) != 0)
{
    // handle track-based transfer
}