Game.Objects.NetObjectFlags
Assembly: Assembly-CSharp.dll
Namespace: Game.Objects
Type: public enum
Base: System.Enum (underlying type: byte)
Summary: NetObjectFlags is a byte-backed flags enum used to represent bitwise state for network-related objects in the game. The [Flags] attribute indicates these values are intended to be combined using bitwise operations. Typical uses include marking whether an object is clear, whether tracks can pass through, or whether an object is oriented/used in a backward direction.
Fields
-
IsClear = 1
This flag likely indicates the object is in a "clear" state (e.g., unobstructed or reset). Value = 0x01. -
TrackPassThrough = 2
Indicates that track entities may pass through the object (e.g., the object does not block track movement). Value = 0x02. -
Backward = 4
Marks the object as backward or reversed (orientation/flow reversed). Value = 0x04.
Properties
- None declared on this enum. Use bitwise operations or Enum helper methods to inspect/combine flags.
Constructors
- None declared. As with all enums, values are compile-time constants and the type can be cast from the underlying byte value. Note: there is no explicit zero/None member defined in this enum; a default value of 0 would represent "no flags set."
Methods
- No instance or static methods are defined on this enum. Standard System.Enum methods (ToString, HasFlag, etc.) are available.
Usage Example
// Combine flags
NetObjectFlags flags = NetObjectFlags.IsClear | NetObjectFlags.TrackPassThrough;
// Check a flag (fast bitwise)
bool canPassThrough = (flags & NetObjectFlags.TrackPassThrough) != 0;
// Add a flag
flags |= NetObjectFlags.Backward;
// Remove a flag
flags &= ~NetObjectFlags.IsClear;
// Using HasFlag (slower, boxing for enums)
bool isBackward = flags.HasFlag(NetObjectFlags.Backward);
// Casting from raw byte (e.g., reading from saved data or a network buffer)
byte raw = 0x03; // IsClear | TrackPassThrough
NetObjectFlags fromRaw = (NetObjectFlags)raw;