Skip to content

Game.Tools.CreationFlags

Assembly: Assembly-CSharp
Namespace: Game.Tools

Type: enum (flags) CreationFlags : uint

Base: System.Enum (backed by System.UInt32)

Summary:
Bitflags used by the game's creation tools to indicate options and behaviors when creating, modifying or manipulating game objects (buildings, props, roads, etc.). Each flag represents a boolean option that can be combined using bitwise operations to control how an object is created or handled by tool code (for example: whether it should be selected after creation, whether it is permanent, whether it is a duplicated/relocated object, etc.).


Fields

  • Permanent = 1u
    Indicates the created object should be permanent (persistent). Often used to mark objects that shouldn't be auto-removed.

  • Select = 2u
    Request that the created object be selected immediately after creation.

  • Delete = 4u
    Marks the action as a deletion operation rather than a normal creation.

  • Attach = 8u
    Indicates the object is being attached to something else (parenting/attachment behavior).

  • Upgrade = 0x10u
    Flag for upgrade operations (replacing or upgrading an existing entity).

  • Relocate = 0x20u
    Indicates the object is being relocated (moved) rather than newly placed.

  • Invert = 0x40u
    Used to invert some property or orientation during creation (context-dependent).

  • Align = 0x80u
    Request alignment behavior (snap/align the new object to grid, other objects, or terrain).

  • Hidden = 0x100u
    Creation should be hidden (not visible in the usual UI or not rendered immediately).

  • Parent = 0x200u
    Indicates parent relationship should be established on creation.

  • Dragging = 0x400u
    Indicates creation is part of a drag operation (continuous placement while dragging).

  • Recreate = 0x800u
    Flag to indicate the object is being re-created (e.g., rebuilding a previously removed object).

  • Optional = 0x1000u
    Marks the creation as optional (may be skipped or rolled back under certain conditions).

  • Lowered = 0x2000u
    Indicates the object should be placed lower in elevation (submerged/offset downwards).

  • Native = 0x4000u
    Used to indicate a "native" creation origin, possibly created by game systems rather than user tools.

  • Construction = 0x8000u
    Marks the object as under construction (temporary state until construction completes).

  • SubElevation = 0x10000u
    Relates to sub-elevation placement (below typical elevation, e.g., tunnels or trenches).

  • Duplicate = 0x20000u
    Indicates this creation is the result of a duplicate operation.

  • Repair = 0x40000u
    Marks the creation as part of a repair operation.

Properties

  • None
    This enum type exposes no properties. It is a plain flags enum used via bitwise operations.

Constructors

  • None
    Enums do not define custom constructors. Values are assigned as named constants.

Methods

  • None
    This enum does not declare methods. Use standard System.Enum/bitwise operations to work with these flags.

Usage Example

// Combine flags when creating an object:
CreationFlags flags = CreationFlags.Permanent | CreationFlags.Select | CreationFlags.Align;

// Check a specific flag:
bool shouldSelect = (flags & CreationFlags.Select) != 0;
// or using HasFlag (slower boxing for older runtimes):
bool shouldSelect2 = flags.HasFlag(CreationFlags.Select);

// Add or remove flags:
flags |= CreationFlags.Dragging;     // add
flags &= ~CreationFlags.Select;      // remove

// Typical usage inside tool logic:
void HandleCreation(CreationFlags flags)
{
    if ((flags & CreationFlags.Delete) != 0)
    {
        // perform deletion logic
    }
    if ((flags & CreationFlags.Upgrade) != 0)
    {
        // perform upgrade logic
    }
    // etc.
}