Skip to content

Game.MailTransferRequestFlags

Assembly:
Game (assembly name may vary depending on modding/runtime setup)

Namespace:
Game.Simulation

Type:
public enum (with [Flags], underlying type: ushort)

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

Summary:
Flags used to describe mail transfer requests in the game's mail/logistics system. This [Flags] enum lets systems combine bits to express direction (deliver/receive), whether transport is required, categories of mail (unsorted, local, outgoing), and return variants of those categories. The underlying ushort limits the range to 16 bits.


Fields

  • Deliver = 1
    Indicates a request to deliver mail to a destination (outgoing direction from the requestor's perspective).

  • Receive = 2
    Indicates a request to receive mail at a destination (incoming direction to the requestor).

  • RequireTransport = 4
    Specifies that the mail requires transport (i.e., needs a vehicle/transport resource to move).

  • UnsortedMail = 0x10 (16)
    Marks the request as involving unsorted mail (general/unsorted category).

  • LocalMail = 0x20 (32)
    Marks the request as local mail (mail that stays within a local area or district).

  • OutgoingMail = 0x40 (64)
    Marks the request as outgoing mail (leaving the local system toward other cities/regions).

  • ReturnUnsortedMail = 0x100 (256)
    Marks the request as returning unsorted mail (a return/redirect of previously unsorted mail).

  • ReturnLocalMail = 0x200 (512)
    Marks the request as returning local mail.

  • ReturnOutgoingMail = 0x400 (1024)
    Marks the request as returning outgoing mail.

Properties

  • None for this enum type; usage is via enum values/bitwise operations.

Constructors

  • No public constructors — enum values are the defined named constants and can be combined/assigned directly.

Methods

  • None defined on the enum itself. Use standard enum/bitwise operations and helper methods (e.g., HasFlag) when working with values.

Usage Example

// Combine flags for a mail request that should be delivered, requires transport, and is local mail:
var flags = MailTransferRequestFlags.Deliver 
            | MailTransferRequestFlags.RequireTransport 
            | MailTransferRequestFlags.LocalMail;

// Check if the request requires transport:
bool needsTransport = (flags & MailTransferRequestFlags.RequireTransport) != 0;
// or using HasFlag (slower boxing on some frameworks):
bool needsTransport2 = flags.HasFlag(MailTransferRequestFlags.RequireTransport);

// Check direction:
bool isDelivery = (flags & MailTransferRequestFlags.Deliver) != 0;
bool isReceive = (flags & MailTransferRequestFlags.Receive) != 0;

// Example: mark a request as returning outgoing mail
flags = MailTransferRequestFlags.ReturnOutgoingMail | MailTransferRequestFlags.RequireTransport;

Notes: - Because this enum is decorated with [Flags], combine values using bitwise OR and test them with bitwise AND or HasFlag. - Values are sparse and reserved across different bit positions — avoid assuming contiguous numeric values.