Game.Net.LaneSignalType
Assembly:
(assembly not specified in source file)
Namespace: Game.Net
Type: public enum
Base: System.Enum (underlying type: System.Byte)
Summary:
Represents lane-level signaling states used by the traffic/AI and networking code. Stored as a single byte for compact serialization. Values indicate how vehicles or AI should treat a given lane (no restriction, must stop, yield, or proceed).
Fields
-
None
Value = 0. No signal or restriction for the lane — default state. -
Stop
Value = 1. Full stop required on the lane (vehicles must stop). -
SafeStop
Value = 2. A safer/conditional stop state — typically indicates stopping but may allow proceeding if conditions are safe (used for more permissive stop behavior in AI or traffic rules). -
Yield
Value = 3. Yield/give-way — vehicles should give priority to others. -
Go
Value = 4. Clear to proceed — lane is explicitly allowed to move.
Properties
- This enum defines no properties.
Constructors
- Enums do not declare constructors. The default underlying numeric values are as listed above; the default enum value is
None
(0) when a variable of this type is default-initialized.
Methods
- This enum declares no custom methods. It inherits standard System.Enum/ValueType/Object methods such as:
- ToString()
- CompareTo(object)
- HasFlag(Enum)
- GetHashCode()
- Equals(object)
Usage Example
using Game.Net;
// read from network byte
byte received = /* received from network */;
LaneSignalType signal = (LaneSignalType)received;
// react to signal
switch (signal)
{
case LaneSignalType.Stop:
case LaneSignalType.SafeStop:
// instruct vehicles to stop or prepare to stop
HandleStop(signal);
break;
case LaneSignalType.Yield:
HandleYield();
break;
case LaneSignalType.Go:
HandleGo();
break;
case LaneSignalType.None:
default:
// no special behavior
break;
}
// send over network
LaneSignalType current = LaneSignalType.Yield;
byte toSend = (byte)current;
SendByteOverNetwork(toSend);