Game.Citizens.AttendingMeeting
Assembly: Assembly-CSharp.dll (game assembly — Cities: Skylines 2 runtime types)
Namespace: Game.Citizens
Type: struct
Base: IComponentData, IQueryTypeParameter, ISerializable
Summary: Component (ECS IComponentData) that marks an entity as attending a meeting by holding a reference to the meeting entity. It implements ISerializable so the meeting reference is saved/loaded by the game's serialization system. Typically used in entity queries and systems that manage citizen meeting behavior (e.g., assigning citizens to meetings, tracking attendance).
Fields
public Unity.Entities.Entity m_Meeting
Reference to the meeting Entity that this citizen (or attendee entity) is attending. May be Entity.Null when not attending any meeting. This is the value serialized/deserialized by the ISerializable implementation.
Properties
- None
This struct exposes no explicit properties; it is a plain data component with a single public field.
Constructors
- Implicit default constructor
As a value type (struct) there is an implicit parameterless constructor that zero-initializes m_Meeting (Entity.Null).
Methods
-
public void Deserialize<TReader>(TReader reader) where TReader : IReader
Reads the stored meeting Entity from the provided reader into m_Meeting. Implementation: reader.Read(out m_Meeting). -
public void Serialize<TWriter>(TWriter writer) where TWriter : IWriter
Writes the m_Meeting Entity to the provided writer. Implementation: writer.Write(m_Meeting).
Usage Example
// Add the component to an entity to mark it as attending a meeting:
var attendeeEntity = /* an entity representing a citizen */;
var meetingEntity = /* an entity representing the meeting */;
var attending = new AttendingMeeting { m_Meeting = meetingEntity };
entityManager.AddComponentData(attendeeEntity, attending);
// Query example: find all attendees for a specific meeting
var query = entityManager.CreateEntityQuery(
ComponentType.ReadOnly<AttendingMeeting>(),
/* other filters as needed */
);
using (var attendees = query.ToComponentDataArray<AttendingMeeting>(Allocator.TempJob))
{
for (int i = 0; i < attendees.Length; i++)
{
if (attendees[i].m_Meeting == meetingEntity)
{
// handle attendee
}
}
}
// Serialization is handled by the game's serialization system via the ISerializable implementation.
// If implementing custom readers/writers, the struct will write/read the m_Meeting field:
writer.Write(meetingEntity); // inside AttendingMeeting.Serialize
reader.Read(out m_Meeting); // inside AttendingMeeting.Deserialize