Game.Net.SubwayTrack
Assembly: Assembly-CSharp (game assembly where Game.Net types reside)
Namespace: Game.Net
Type: struct
Base: System.ValueType (implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter, Colossal.Serialization.Entities.IEmptySerializable)
Summary:
SubwayTrack is an empty marker component used by the game's ECS to identify entities that represent subway track segments. The struct is annotated with StructLayout(LayoutKind.Sequential, Size = 1) so it occupies one byte (non-zero size) for interop/serialization reasons and to satisfy serializers that do not accept zero-sized types. Implementing IComponentData makes it usable as a Unity.Entities component; IQueryTypeParameter allows it to be used in query APIs; IEmptySerializable indicates support for the game's custom (Colossal) serialization handling for empty marker types.
Fields
- (none) Extra info: The struct contains no managed fields. The StructLayout attribute with Size = 1 ensures a non-zero size at runtime and when serialized, despite the lack of fields.
Properties
- (none) Extra info: There are no properties defined. The type acts purely as a tag/marker component.
Constructors
- default (implicit) constructor Extra info: As a C# value type, SubwayTrack has the implicit parameterless constructor that initializes the single-byte footprint to the default value. No custom constructors are defined.
Methods
- (none) Extra info: The type defines no methods. Behavior and logic tied to subway tracks are implemented elsewhere (systems and other components); this type is intended only to tag entities.
Usage Example
// Add the SubwayTrack marker to an entity using the EntityManager
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity subwayEntity = entityManager.CreateEntity();
entityManager.AddComponentData(subwayEntity, new Game.Net.SubwayTrack());
// Query for entities that have the SubwayTrack marker in a system (example using Entities API)
Entities
.WithAll<Game.Net.SubwayTrack>()
.ForEach((Entity e) =>
{
// e is an entity that represents a subway track segment
})
.WithoutBurst()
.Run();
Additional notes: - Use this component when you need to filter or tag entities as subway tracks so systems can efficiently operate on them. - The IEmptySerializable implementation indicates the type participates in the game's custom serialization; do not assume it is a plain unmanaged empty struct for all subsystems.