Skip to content

Game.Buildings.ParkMaintenance

Assembly: Assembly-CSharp (typical game assembly; the exact assembly may vary by build)
Namespace: Game.Buildings

Type: struct

Base: IComponentData, IQueryTypeParameter, IEmptySerializable

Summary: ParkMaintenance is an empty/tag ECS component used to mark entities (typically buildings) that represent park maintenance functionality. The struct is explicitly laid out with Size = 1 to ensure it is not a zero-sized type (avoiding certain runtime/storage issues) and to keep its memory footprint minimal. Implementing IComponentData makes it usable in Unity's ECS; IQueryTypeParameter enables using the type in query APIs; IEmptySerializable indicates support for the game's serialization conventions for empty components.


Fields

  • (none)
    This struct contains no instance fields. It is used as a marker/tag component.

Properties

  • (none)
    No properties are defined.

Constructors

  • public ParkMaintenance()
    The default parameterless constructor is the implicit, compiler-provided constructor. The type is an empty value-type used only as a marker.

Methods

  • (none)
    No methods are defined on this struct.

Usage Example

// Add the marker component to an entity
var entity = entityManager.CreateEntity(typeof(Game.Buildings.ParkMaintenance));

// or add to an existing entity
entityManager.AddComponentData(entity, new Game.Buildings.ParkMaintenance());

// Query or operate on entities that have the marker
public partial class ParkMaintenanceSystem : Unity.Entities.SystemBase
{
    protected override void OnUpdate()
    {
        // Example: perform work only on entities tagged with ParkMaintenance
        Entities
            .WithAll<Game.Buildings.ParkMaintenance>()
            .ForEach((Entity entity) =>
            {
                // handle park maintenance logic for this entity
            })
            .Schedule();
    }
}

Notes: - The StructLayout(Size = 1) attribute ensures a non-zero size for the empty struct, which can be important for certain serialization/storage or native interop expectations. - Use this component as a lightweight tag to filter/query entities in ECS systems; no payload data is stored in the component itself.