Game.Prefabs.TaxiwayData
Assembly:
Assembly-CSharp
Namespace:
Game.Prefabs
Type:
struct
Base:
IComponentData, IQueryTypeParameter, ISerializable
Summary:
TaxiwayData is a lightweight ECS component (IComponentData) that stores per-taxiway configuration used by the game. It contains a speed limit and a set of flags describing taxiway behavior/state. It also implements ISerializable to control how the component is written to and read from the game's serialization streams (used for saving/loading or prefab serialization).
Fields
-
public float m_SpeedLimit
Holds the speed limit for the taxiway. This value is written/read as a single float by the Serialize/Deserialize methods and is used by game logic that enforces or queries taxiway speeds. -
public TaxiwayFlags m_Flags
Bitflags (an enum) describing taxiway properties/state (e.g., mode flags, enabled/disabled, directionality, etc.). Stored as a uint in the serialized form and cast back to TaxiwayFlags when deserializing.
Properties
- This type does not declare any properties. It exposes only public fields and implements required interfaces.
Constructors
public TaxiwayData()
Struct default constructor (implicit). When created via default constructor fields are zero-initialized: m_SpeedLimit == 0f and m_Flags == 0 (no flags set). You can also initialize via an object initializer.
Methods
public void Serialize<TWriter>(TWriter writer) where TWriter : IWriter
Writes the component data in a stable order to the provided writer. Implementation details:- Writes m_SpeedLimit as a float.
-
Writes m_Flags cast to uint. This ordering must match Deserialize to ensure correct round-trip serialization.
-
public void Deserialize<TReader>(TReader reader) where TReader : IReader
Reads the component data from the provided reader in the same order used by Serialize: - Reads a float into m_SpeedLimit.
- Reads a uint and casts it to TaxiwayFlags, assigning to m_Flags.
Both methods are generic over the reader/writer interfaces used by the game's serialization system and assume the caller provides compatible IReader/IWriter implementations.
Usage Example
// Create and initialize
var taxiway = new TaxiwayData
{
m_SpeedLimit = 12.5f,
m_Flags = TaxiwayFlags.Open | TaxiwayFlags.AllowReverse
};
// Serialize to a writer (writer must implement IWriter)
taxiway.Serialize(writer);
// Deserialize from a reader (reader must implement IReader)
var loaded = default(TaxiwayData);
loaded.Deserialize(reader);