Skip to content

Game.Net.SlaveLaneFlags

Assembly: Assembly-CSharp.dll
Namespace: Game.Net

Type: enum (flag)

Base: System.Enum

Summary: SlaveLaneFlags is a bitmask-style enumeration (marked with [Flags]) used to describe properties and relationships of a "slave" lane in the networking/road system (e.g., lane connection, splitting, merging and open directions). Each value represents a single boolean attribute that can be combined with others using bitwise operations to express multiple characteristics for a lane at once.


Fields

  • AllowChange = 1
    Allows lane changing to/from this slave lane.

  • StartingLane = 2
    Marks the lane as a starting lane (beginning of a segment or flow).

  • EndingLane = 4
    Marks the lane as an ending lane (end of a segment or flow).

  • MultipleLanes = 8
    Indicates multiple lanes in this group or multiple-lane behavior.

  • MergingLane = 0x10 (16)
    Indicates the lane participates in a merge.

  • OpenStartLeft = 0x20 (32)
    Start of the lane is open to the left (an available connection/turn to the left at the start).

  • OpenStartRight = 0x40 (64)
    Start of the lane is open to the right.

  • OpenEndLeft = 0x80 (128)
    End of the lane is open to the left.

  • OpenEndRight = 0x100 (256)
    End of the lane is open to the right.

  • SplitLeft = 0x200 (512)
    The lane splits to the left.

  • SplitRight = 0x400 (1024)
    The lane splits to the right.

  • MiddleStart = 0x800 (2048)
    Indicates a middle/start point (used when lane layout has a middle connection that starts here).

  • MiddleEnd = 0x1000 (4096)
    Indicates a middle/end point (used when a middle connection ends here).

  • MergeLeft = 0x2000 (8192)
    Indicates merging from the left side into this lane.

  • MergeRight = 0x4000 (16384)
    Indicates merging from the right side into this lane.

Notes: - Values are powers of two so they can be combined using bitwise OR to represent multiple simultaneous properties. - The [Flags] attribute makes the enum suitable for bitwise operations and friendly string formatting of combined values.

Properties

  • None (this enum exposes only named constant values; use bitwise operations or Enum helper methods to inspect/modify).

Constructors

  • None (enums have no user-defined constructors; underlying type is int by default).

Methods

  • None defined on the enum type itself.
  • Use standard System.Enum methods and bitwise operators:
  • Enum.HasFlag(...) or (flags & SlaveLaneFlags.SomeFlag) != 0 to check flags.
  • Combine with |, remove with & ~, toggle with ^.

Usage Example

using Game.Net;

// Set flags: a lane that allows changes, is a starting lane and is open to the right at its end
SlaveLaneFlags flags = SlaveLaneFlags.AllowChange | SlaveLaneFlags.StartingLane | SlaveLaneFlags.OpenEndRight;

// Check whether a flag is present
bool allowsChange = flags.HasFlag(SlaveLaneFlags.AllowChange);
// or:
bool isStarting = (flags & SlaveLaneFlags.StartingLane) != 0;

// Add a flag
flags |= SlaveLaneFlags.MultipleLanes;

// Remove a flag
flags &= ~SlaveLaneFlags.StartingLane;

// Toggle a flag
flags ^= SlaveLaneFlags.MergingLane;

// Print combined flags (thanks to [Flags], this shows names)
Console.WriteLine(flags); // e.g. "AllowChange, MultipleLanes, OpenEndRight"