Game.Prefabs.TrainCarriageData
Assembly:
Assembly-CSharp (game assembly; actual assembly name may vary per mod build)
Namespace:
Game.Prefabs
Type:
struct
Base:
Implements: Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable
Summary:
TrainCarriageData is an empty/tag ECS component used to mark entities as train carriages within the game's entity-component system. The struct is explicitly given a sequential layout with Size = 1 (via StructLayout) so it occupies a non-zero size in memory/serialization contexts. It acts as a marker for queries, systems, and serialization logic that need to identify or operate on train carriage entities.
Fields
- This struct declares no fields. It is intentionally empty and used as a tag component.
Properties
- This struct exposes no properties.
Constructors
public TrainCarriageData()
The default parameterless struct constructor (value is default-initialized). No custom constructor is defined in source.
Methods
- This struct declares no methods. It only implements marker interfaces to integrate with the ECS and the game's serialization system.
Usage Example
// Example: add the TrainCarriageData tag to an entity
var em = Unity.Entities.World.DefaultGameObjectInjectionWorld.EntityManager;
Entity carriageEntity = em.Instantiate(trainCarriagePrefabEntity);
// Add the marker/tag component
em.AddComponentData(carriageEntity, new Game.Prefabs.TrainCarriageData());
// Later, systems can query for entities with this tag:
// Entities.ForEach((Entity e, in Game.Prefabs.TrainCarriageData tag) => { ... });