Skip to content

Game.Tools.CoursePosFlags

Assembly:
Game

Namespace: Game.Tools

Type:
enum (flags)

Base:
System.Enum (underlying type: System.UInt32)

Summary:
CoursePosFlags is a bitwise flags enumeration used by the game's tooling to describe characteristics and behaviors of course/placement positions (such as road/course nodes or segments) during construction and editing. Each flag represents a boolean attribute (position is first/last, alignment, side, transitions, elevation enforcement, merge behavior, grid placement, etc.). Flags can be combined using bitwise operations to represent multiple attributes simultaneously.


Fields

  • IsFirst = 1u
    Mark this position as the first point in a course/segment sequence.

  • IsLast = 2u
    Mark this position as the last point in a course/segment sequence.

  • HalfAlign = 4u
    Use half alignment (typically used to offset placement by half a unit/width).

  • IsParallel = 8u
    Indicates the course/segment is parallel (used to align or place parallel elements).

  • IsRight = 0x10u
    Indicates placement on the right side.

  • IsLeft = 0x20u
    Indicates placement on the left side.

  • IsFixed = 0x40u
    This position is fixed and should not be adjusted by automatic alignment or snapping.

  • FreeHeight = 0x80u
    Height is free/unconstrained for this position (do not force to ground or other constraints).

  • LeftTransition = 0x100u
    This position is a left-hand transition (used for lane/placement transitions).

  • RightTransition = 0x200u
    This position is a right-hand transition.

  • ForceElevatedNode = 0x400u
    Force the node at this position to be elevated.

  • ForceElevatedEdge = 0x800u
    Force the edge/segment connected to this position to be elevated.

  • DisableMerge = 0x1000u
    Disable automatic merging with nearby nodes/segments.

  • IsGrid = 0x2000u
    Mark the position as grid-aligned (snap to grid behavior).

  • DontCreate = 0x4000u
    Do not create this node/segment (used to mark planned-but-not-created positions).

Properties

  • None (this is a plain flags enum; use bitwise operators or Enum.HasFlag for queries).

Constructors

  • None (enums do not define instance constructors; values are assigned from the underlying uint).

Methods

  • None defined on the enum itself. Use standard bitwise operations or System.Enum.HasFlag to test flags.

Examples: - Check: (flags & CoursePosFlags.IsFirst) != 0 - Using Enum helper: flags.HasFlag(CoursePosFlags.IsFirst) - Combine: CoursePosFlags.IsFirst | CoursePosFlags.IsRight

Usage Example

// Combining flags
CoursePosFlags flags = CoursePosFlags.IsFirst | CoursePosFlags.HalfAlign;

// Bitwise check (recommended for performance)
if ((flags & CoursePosFlags.IsFirst) != 0)
{
    // handle first position
}

// Using Enum.HasFlag (clearer but slightly slower)
if (flags.HasFlag(CoursePosFlags.HalfAlign))
{
    // handle half alignment
}

// Setting and clearing flags
flags |= CoursePosFlags.IsGrid;            // add a flag
flags &= ~CoursePosFlags.DontCreate;       // remove a flag