Skip to content

Game.Buildings.RentersUpdated

Assembly: Assembly-CSharp
Namespace: Game.Buildings

Type: struct

Base: System.ValueType, implements Unity.Entities.IComponentData, Unity.Entities.IQueryTypeParameter

Summary: Represents a marker/data component indicating that the renters for a particular property entity have been updated. It stores a reference to the property entity whose renters changed. This component is intended for use with Unity DOTS/ECS systems to signal or filter entities when renter-related state changes occur (for example, to trigger UI updates, re-evaluate building occupancy, or propagate changes to other systems).


Fields

  • public Unity.Entities.Entity m_Property Holds the Entity reference to the property (building/lot) whose renters were updated. This allows systems that receive or query this component to know which property the update pertains to.

Properties

  • None. This struct exposes a public field rather than properties.

Constructors

  • public RentersUpdated(Unity.Entities.Entity property) Constructs a RentersUpdated component with the provided property entity reference.

Methods

  • None. This is a simple POD/IComponentData type with no methods.

Usage Example

// Add the component to an existing property entity to mark it as having updated renters:
var propertyEntity = /* an Entity that represents a property */;
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(propertyEntity, new Game.Buildings.RentersUpdated(propertyEntity));

// Alternatively, from a System using an EntityCommandBuffer:
commandBuffer.AddComponent(propertyEntity, new Game.Buildings.RentersUpdated(propertyEntity));

// Querying for entities that have a RentersUpdated component:
Entities
    .WithAll<Game.Buildings.RentersUpdated>()
    .ForEach((Entity e, ref Game.Buildings.RentersUpdated updated) =>
    {
        var property = updated.m_Property;
        // Handle renter update for 'property'...
    }).Schedule();

Notes: - As an IComponentData struct, RentersUpdated must be blittable and can be used in Burst-compiled jobs and scheduled systems. - Use EntityCommandBuffer when adding/removing this component from a job or when modifying entities during structural changes to avoid safety/consistency issues.