Skip to content

Game.Buildings.RentActionFlags

Assembly:
Game (assembly containing game types)

Namespace: Game.Buildings

Type: enum (System.Enum)

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

Summary: RentActionFlags is a small enum used to represent actions related to "rent" handling for buildings. It has an explicit underlying type of byte and defines two values: Storage (1) and Remove (2). Although its name suggests it could be used as a bitmask/flags enum, the enum is not decorated with the [Flags] attribute in the source. If these values are intended to be combined as bit flags, adding [Flags] would be appropriate.


Fields

  • Storage = 1 Represents the "store" action. As the first enumerated value it is explicitly set to 1 (0x01), which makes it usable as a single-bit flag.

  • Remove = 2 Represents the "remove" action. This value is implicitly 2 (0x02) following the previous explicit value. Together with Storage these values form distinct bits (1 and 2) that can be combined bitwise.

Properties

This enum does not declare any properties. Standard System.Enum members (such as ToString, GetValues, etc.) are available.

Constructors

Enums do not declare explicit constructors in C# source. The runtime provides the underlying value handling for the enum type.

Methods

No methods are declared on this enum. You can use standard System.Enum methods (Enum.HasFlag, Enum.ToString, Enum.GetValues, etc.) or perform bitwise operations on the enum values when appropriate.

Usage Example

// Single value
RentActionFlags action = RentActionFlags.Storage;

// Check by equality
if (action == RentActionFlags.Storage) {
    // handle storage action
}

// Using as bit flags (works at runtime even without [Flags], but consider adding [Flags] for clarity)
RentActionFlags combined = RentActionFlags.Storage | RentActionFlags.Remove;

// Test for a flag
bool hasStorage = (combined & RentActionFlags.Storage) != 0;
bool hasRemove  = (combined & RentActionFlags.Remove) != 0;

// Recommended: if you intend to combine values, consider adding [Flags] to the enum definition:
// [Flags]
// public enum RentActionFlags : byte { Storage = 1, Remove = 2 }