Game.PlacementFlags
Assembly:
Namespace: Game.Net
Type: enum
Base: System.Enum
Summary:
A bitwise flag enum (marked with [Flags]) used by the game's networking/placement systems to describe placement characteristics and options for network elements (roads, links, nodes, upgrades, etc.). Each flag represents a single boolean attribute that can be combined to express multiple placement behaviors or constraints (for example: whether an item is placed on the ground, is an upgrade, or should allow parallel placement). This enum is typically used by placement logic, serialization of placement intents, and upgrade/connection rules in Cities: Skylines 2 modding.
Fields
-
None = 0
Represents no flags set. Default value meaning no special placement attributes. -
OnGround = 1
Indicates the placed element should be positioned on the ground surface (as opposed to floating or elevated). Value: decimal 1 (0x1). -
Floating = 2
Marks the element as floating (not anchored to ground elevation). Often used for bridges, elevated tracks, or other non-ground placements. Value: decimal 2 (0x2). -
IsUpgrade = 4
Signifies that the placement operation is an upgrade rather than a new placement. Used to apply upgrade-specific logic or restrictions. Value: decimal 4 (0x4). -
UpgradeOnly = 8
Indicates that this placement is valid only for upgrade operations (not for regular initial placement). Value: decimal 8 (0x8). -
AllowParallel = 0x10
Permits parallel placement of this element alongside existing ones (e.g., allowing another road/link next to an existing one). Value: decimal 16 (0x10). -
NodeUpgrade = 0x20
Specifies that the upgrade applies to a node (intersection/junction) rather than a link. Used to differentiate node-specific upgrade logic. Value: decimal 32 (0x20). -
FlowLeft = 0x40
Indicates flow orientation to the left. Likely used for directionality of one-way flows or lane flow assignments. Value: decimal 64 (0x40). -
FlowRight = 0x80
Indicates flow orientation to the right. Complementary to FlowLeft for specifying direction. Value: decimal 128 (0x80). -
UndergroundUpgrade = 0x100
Marks the upgrade or placement as occurring underground (tunnelling/underground segments). Value: decimal 256 (0x100). -
LinkAuxOffsets = 0x200
Used to enable or indicate auxiliary offset handling for links (e.g., alternate link offsets for complex connection geometry). Value: decimal 512 (0x200). -
ShoreLine = 0x400
Indicates placement related to a shoreline (coastal alignment) or special handling when placing along water edges. Value: decimal 1024 (0x400).
Properties
- None declared on the enum type itself. Use standard enum and bitwise operations or Enum.HasFlag to query flags.
Constructors
- Enums do not declare constructors here. The default enum value is
PlacementFlags.None
(0). You can create values by casting integers or combining existing flags with bitwise OR.
Methods
- No methods are declared on this enum. Use standard enum/bitwise operations:
- Combine: flagA | flagB
- Test: (flags & PlacementFlags.SomeFlag) != 0 or flags.HasFlag(PlacementFlags.SomeFlag)
- Remove: flags & ~PlacementFlags.SomeFlag
Usage Example
// Combine flags for a ground placement that allows parallel placement
PlacementFlags flags = PlacementFlags.OnGround | PlacementFlags.AllowParallel;
// Check for a specific flag
bool isOnGround = (flags & PlacementFlags.OnGround) != 0;
// or
bool allowsParallel = flags.HasFlag(PlacementFlags.AllowParallel);
// Example: treat upgrade-specific logic
if (flags.HasFlag(PlacementFlags.IsUpgrade))
{
// perform upgrade workflow
}
// Example: set flags for an underground node upgrade with auxiliary offsets
PlacementFlags upgradeFlags = PlacementFlags.NodeUpgrade | PlacementFlags.UndergroundUpgrade | PlacementFlags.LinkAuxOffsets;