Game.Objects.PlacementFlags
Assembly: Assembly-CSharp.dll
Namespace: Game.Objects
Type: enum
Base: System.Int32
Summary: PlacementFlags is a bitmask enum used by the game's object placement system to describe where and how an object may be placed in the world. Flags indicate allowed surfaces (ground, water, road), special placement behaviours (snapping to nodes/edges, floating, hovering), interaction constraints (unique, can overlap), and other placement-related characteristics. Multiple flags can be combined using bitwise operations.
Fields
-
None = 0No special placement requirements. Default value indicating no flags set. -
RoadSide = 1Object is intended to be placed on the side of a road (e.g., street furniture, signs). -
OnGround = 2Object should be placed directly on terrain/ground surface. -
OwnerSide = 4Placement is tied to the owner's side of a boundary (used for assets that depend on property/ownership side). -
CanOverlap = 8Object is allowed to overlap with other objects (placement system will permit overlapping). -
Shoreline = 0x10Object is intended for shoreline placement (between land and water). -
Floating = 0x20Object floats on water (e.g., boats, floating decorations). -
Hovering = 0x40Object floats above the surface (not sitting directly on ground or water). -
HasUndergroundElements = 0x80Object has parts that extend underground (pipes, foundations, subterranean elements). -
RoadNode = 0x100Object is meant to snap to road nodes/intersections. -
Unique = 0x200Only one instance (or limited instances) allowed — treated as unique for placement rules. -
Wall = 0x400Object behaves like a wall (placement/attachment behaviour similar to walls). -
Hanging = 0x800Object hangs from other structures (e.g., suspended decorations). -
NetObject = 0x1000Object is considered part of the net/transport network (roads, rails, pipes). -
RoadEdge = 0x2000Object snaps to or is placed along the edge of a road rather than the side or node. -
Swaying = 0x4000Object uses swaying/physics animation (e.g., trees, flags influenced by wind). -
HasProbability = 0x8000Object placement considers probability/weight (used by procedural placement systems). -
Underwater = 0x10000Object is intended for underwater placement. -
Waterway = 0x20000Object is specifically for waterways (channels, river-specific placements). -
SubNetSnap = 0x40000Object snaps to subnet elements (sub-networks) rather than main net geometry. -
Attached = 0x80000Object is attached to another object and relies on that attachment for placement.
Properties
- This enum type does not define instance properties. Use bitwise operators or System.Enum/Enum.HasFlag helpers to query values.
Constructors
- Enums in C# cannot define explicit constructors in source; values are created by assigning the enum type. No public constructors are provided here.
Methods
- The enum does not declare any custom methods. Use standard enum helpers and operations:
- Bitwise operators: &, |, ^, ~ to combine or test flags.
- Enum.HasFlag(PlacementFlags flag) to test presence of a flag.
- ToString(), Enum.GetName(), Enum.GetValues() as needed.
Usage Example
// Combine flags when defining an object's placement behaviour
PlacementFlags flags = PlacementFlags.OnGround | PlacementFlags.RoadSide | PlacementFlags.CanOverlap;
// Test flags with bitwise check
bool allowsOverlap = (flags & PlacementFlags.CanOverlap) != 0;
// Or using HasFlag (slower but more readable)
if (flags.HasFlag(PlacementFlags.RoadSide))
{
// Snap placement to road side logic...
}
// Example: check if an object can be placed on water
bool canBeOnWater = flags.HasFlag(PlacementFlags.Floating) || flags.HasFlag(PlacementFlags.Underwater);