Game.Buildings.ExtensionFlags
Assembly: Assembly-CSharp.dll
Namespace: Game.Buildings
Type: public enum (marked with [Flags])
Base: System.Enum (underlying type: byte)
Summary: A small flags enum used to represent simple extension-related state for a building. The enum is decorated with the [Flags] attribute and uses a byte as its underlying storage, so values are intended to be combined bitwise. Currently defines a "None" (no flags) and "Disabled" flag to indicate a disabled extension.
Fields
-
None = 0
No flags are set. Use this value to indicate the default/normal state. -
Disabled = 1
Indicates the extension is disabled. This flag can be tested with bitwise operations or Enum.HasFlag.
Properties
- This enum type does not declare any properties.
Use standard enum casts and System.Enum helpers if you need to read underlying values (for example,(byte)myFlag
).
Constructors
- Enums do not expose public constructors. Values are the defined named constants above and cannot be constructed via a public ctor.
Methods
- No instance methods are declared on this enum type itself.
- Common patterns when working with this flags enum:
- Test a flag:
(flags & ExtensionFlags.Disabled) != 0
orflags.HasFlag(ExtensionFlags.Disabled)
- Set a flag:
flags |= ExtensionFlags.Disabled;
- Clear a flag:
flags &= ~ExtensionFlags.Disabled;
- Get raw underlying value:
byte raw = (byte)flags;
- You can also use standard System.Enum methods such as Enum.Parse / Enum.TryParse when converting from strings.
Usage Example
// Set and test flags
ExtensionFlags flags = ExtensionFlags.None;
// Enable the Disabled flag
flags |= ExtensionFlags.Disabled;
// Check if Disabled is set (bitwise)
if ((flags & ExtensionFlags.Disabled) != 0)
{
// handle disabled extension
}
// Or using Enum.HasFlag
if (flags.HasFlag(ExtensionFlags.Disabled))
{
// handle disabled extension
}
// Clear the Disabled flag
flags &= ~ExtensionFlags.Disabled;
// Read underlying byte value (useful for serialization or native interop)
byte raw = (byte)flags;