Game.Buildings.RoadMaintenance
Assembly:
Assembly-CSharp (game code assembly; actual assembly name may vary in modding setups)
Namespace: Game.Buildings
Type: struct
Base:
System.ValueType
Implements: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary: RoadMaintenance is an empty/marker ECS component type used by the game's entity systems to tag entities related to road maintenance (e.g., maintenance buildings, schedules or tasks). The struct is laid out with StructLayout(LayoutKind.Sequential, Size = 1) so it occupies a predictable minimal size (1 byte) and can be serialized as an empty component. Implementing IComponentData makes it usable as a regular ECS component; IQueryTypeParameter allows it to be used directly in query type parameters; IEmptySerializable marks it as an empty-serializable component for the game's serialization pipeline.
Fields
- None — this struct declares no instance fields; it acts purely as a marker component.
Properties
- None — there are no properties on this type.
Constructors
- public RoadMaintenance() This type relies on the implicit parameterless constructor provided for value types. No custom constructors are defined.
Methods
- None — the struct does not declare methods. The implemented interfaces are marker-like and do not add instance methods here.
Usage Example
// Add the marker component to an entity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(entity, new Game.Buildings.RoadMaintenance());
// Remove the marker component
entityManager.RemoveComponent<Game.Buildings.RoadMaintenance>(entity);
// Query for entities with the marker
EntityQuery query = entityManager.CreateEntityQuery(
ComponentType.ReadOnly<Game.Buildings.RoadMaintenance>());
// In a SystemBase/Job using a query parameter
Entities
.WithAll<Game.Buildings.RoadMaintenance>()
.ForEach((Entity e, in SomeOtherComponent comp) =>
{
// process road-maintenance-tagged entities
}).Schedule();
Notes: - Because this is an empty/marker component, use AddComponent/RemoveComponent or WithAll/WithNone when constructing queries. - The StructLayout(Size = 1) ensures compatibility with the game's serialization and memory layout expectations for empty components.