Game.Tutorials.ObjectPlacementTriggerFlags
Assembly:
Assembly-CSharp (game code / modding assembly)
Namespace:
Game.Tutorials
Type:
public enum (flag enum)
Base:
System.Enum (underlying type: System.Int32)
Summary:
Flags used by the game's tutorial/object-placement systems to describe required conditions for placing an object. The enum is marked with [Flags] so multiple requirements can be combined using bitwise operations. Typical uses include checking whether a tutorial step requires a road connection, elevation, specific utility connections, or whether sub-objects are allowed.
Fields
-
AllowSubObject = 1
Allows placement of sub-objects (child/secondary parts) as part of the object placement operation. -
RequireElevation = 2
Requires the object to be placed at a specific elevation (height) or that elevation constraints are met. -
RequireRoadConnection = 4
Requires the placed object to have a road connection. -
RequireTransformerConnection = 8
Requires the placed object to be connected to a transformer (electricity distribution). -
RequireSewageOutletConnection = 0x10
Requires the placed object to be connected to a sewage outlet (sewer connection). -
RequireElectricityProducerConnection = 0x20
Requires the placed object to be connected to an electricity-producing building or source. -
RequireOutsideConnection = 0x40
Requires an outside connection (e.g., connection to outside world services or networks). -
RequireResourceConnection = 0x80
Requires a resource connection (specific resource network connection).
Properties
- None (enum type — no custom properties)
{{ The enum is a simple bitmask; use bitwise operations or Enum.HasFlag to inspect combined values. }}
Constructors
- None (enum — uses system-provided behavior)
{{ Enums do not define explicit constructors; values are compile-time constants. }}
Methods
- None defined on the enum itself (inherits System.Enum/System.ValueType methods such as ToString(), HasFlag(), etc.)
{{ Use standard Enum/bitwise helpers to work with these flags. }}
Usage Example
// Combine multiple requirements
ObjectPlacementTriggerFlags flags = ObjectPlacementTriggerFlags.RequireRoadConnection
| ObjectPlacementTriggerFlags.RequireElevation
| ObjectPlacementTriggerFlags.RequireTransformerConnection;
// Check with bitwise operation
if ((flags & ObjectPlacementTriggerFlags.RequireRoadConnection) != 0)
{
// Road connection is required
}
// Or using Enum.HasFlag (note: HasFlag has boxing overhead)
if (flags.HasFlag(ObjectPlacementTriggerFlags.RequireElevation))
{
// Elevation requirement is present
}
// Remove a flag
flags &= ~ObjectPlacementTriggerFlags.RequireTransformerConnection;
{{ Tips: - Because the enum is marked with [Flags], combine values with | and test with & or HasFlag. - Values are powers of two (1,2,4,8,16,32,64,128), so they can be uniquely combined. - Useful for tutorial logic to validate placement preconditions and to present UI hints based on required connections/constraints. }}