Game.Buildings.RentAction
Assembly:
Unknown (project assembly - typically the game's main assembly or the mod's assembly)
Namespace: Game.Buildings
Type: struct
Base: System.ValueType
Summary: Represents a simple ECS component struct used to model a "rent" action between a property and a renter in the simulation. This component holds Entity references for the property and the renter, plus a set of flags (RentActionFlags) that describe the action's state or options. It is intended to be added to entities that represent scheduled or in-progress rent operations and processed by relevant systems (e.g., job or behaviour systems that handle renting logic).
Fields
-
public Unity.Entities.Entity m_Property
Represents the Entity for the property or building being rented. Systems processing rent actions will use this reference to find property data/components (e.g., building info, rent rates, availability). -
public Unity.Entities.Entity m_Renter
Represents the Entity for the tenant/renter (an agent, citizen, or other actor). Systems will use this to access the renter's components (e.g., wallet, household, status) when resolving the rent action. -
public RentActionFlags m_Flags
Holds flags that modify or describe the rent action. RentActionFlags is an enum (not shown here) that typically encodes states or options such as whether the action is pending, completed, cancelled, or any other behaviour modifiers. See RentActionFlags for exact flag definitions.
Properties
- None. This struct only exposes public fields and does not define any managed properties.
Constructors
- Implicit default constructor (public RentAction()) As a value type (struct), RentAction has the implicit parameterless constructor that initializes Entity fields to Entity.Null and the flags field to the default enum value. No custom constructors are defined in the source.
Methods
- None. The struct has no methods; it is a plain data container intended for use as a component in ECS.
Usage Example
// Example: creating/assigning a RentAction component to an entity using an EntityManager
using Unity.Entities;
using Game.Buildings;
// Assume we have references to an EntityManager, a propertyEntity and a renterEntity
EntityManager entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
Entity rentActionEntity = entityManager.CreateEntity();
// Add the RentAction component to represent a new rent operation
entityManager.AddComponentData(rentActionEntity, new RentAction {
m_Property = propertyEntity,
m_Renter = renterEntity,
m_Flags = RentActionFlags.None // or an appropriate initial flag value
});
// A system would later read/process this component, perform the rent logic, then remove or update it.
{{ Additional information: - Typical usage: attach this component to lightweight "action" entities (work items) which systems pick up and process in update loops or jobs. - The struct is blittable and safe to use in jobs as long as referenced component data accessed via Entity is handled correctly by the systems. - Avoid storing managed references (UnityEngine.Object) alongside this struct; keep interactions to ECS components and systems. - Check the definition of RentActionFlags in the codebase to know which flag values to use and how they affect processing logic. }}