Skip to content

Game.Simulation.LeisureEvent

Assembly: Assembly-CSharp (most likely; actual assembly name may vary depending on the game/mod build)

Namespace: Game.Simulation

Type: struct

Base: System.ValueType

Summary:
Represents a simple data container for a leisure interaction in the simulation. Holds references to the citizen entity involved and the provider (service or facility) entity that supplies the leisure. This struct is a plain value type intended to be used as event data or as a component payload in ECS-style code.


Fields

  • public Entity m_Citizen
    Holds the Entity that represents the citizen participating in the leisure event (the consumer/visitor).

  • public Entity m_Provider
    Holds the Entity that represents the provider of the leisure service or facility (the source/venue).

Properties

  • None

Constructors

  • Implicit default constructor (value-type default)
    Creates a LeisureEvent with default Entity values (Entity.Null). No explicit constructors are defined in the source.

Methods

  • None

Usage Example

// Example: create and attach a LeisureEvent to an entity using EntityManager
// Note: LeisureEvent must be used as a component type (implement IComponentData) if you intend to AddComponentData.
// The struct in the source is a plain struct; add IComponentData where appropriate in your mod code.

Entity citizen = /* obtain citizen entity */;
Entity provider = /* obtain provider entity */;
LeisureEvent leisure = new LeisureEvent { m_Citizen = citizen, m_Provider = provider };

// If LeisureEvent is a valid ECS component type:
entityManager.AddComponentData(targetEventEntity, leisure);

// Or use it as transient event data in systems:
SomeSystem.QueueLeisureEvent(leisure);

{{ This struct is minimal and contains no behavior. If you intend to store it as an ECS component, ensure it implements the appropriate Unity.Entities interfaces (for example, IComponentData) according to the ECS version used by Cities: Skylines 2. Consider naming conventions (avoid public field names starting with "m_" unless matching project style) and potential null/Entity.Null checks when consuming the event. }}