Game.Events.FindingEventParticipants
Assembly: Assembly-CSharp
Namespace: Game.Events
Type: struct
Base: System.ValueType (implements IComponentData, IQueryTypeParameter, IEmptySerializable)
Summary: FindingEventParticipants is an empty marker component used by the game's ECS-based event systems to tag or filter entities that are considered participants in a "finding" event. The struct is intentionally empty and marked with a fixed size via StructLayout to ensure it is serializable and usable as a component in entity queries and serialization systems.
Fields
- This component defines no instance fields.
The struct is decorated with [StructLayout(LayoutKind.Sequential, Size = 1)] so it occupies a single byte; this prevents it from being a zero-sized type and ensures compatibility with serialization and certain ECS tooling.
Properties
- None. The struct contains no properties.
Constructors
- public FindingEventParticipants() (implicit) This struct relies on the default/implicit parameterless constructor provided by the runtime. As an empty marker component, no custom construction logic is required.
Methods
- None. The type does not declare any methods.
Usage Example
// Add the marker component to an entity (classic EntityManager API)
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
entityManager.AddComponentData(entity, new Game.Events.FindingEventParticipants());
// Check for participation
bool isParticipant = entityManager.HasComponent<Game.Events.FindingEventParticipants>(entity);
// Use as a query filter (classic Entities.ForEach pattern)
Entities.WithAll<Game.Events.FindingEventParticipants>()
.ForEach((Entity e, in SomeOtherData data) =>
{
// process event participant entity
}).Schedule();
// Or add/remove within a system
if (shouldParticipate)
{
entityManager.AddComponentData(entity, new Game.Events.FindingEventParticipants());
}
else
{
if (entityManager.HasComponent<Game.Events.FindingEventParticipants>(entity))
entityManager.RemoveComponent<Game.Events.FindingEventParticipants>(entity);
}
Additional notes: - Implements IQueryTypeParameter to allow this type to be used directly in query/filter APIs. - Implements IEmptySerializable (from Colossal.Serialization.Entities) to integrate with the game's custom serialization for empty components. - Keep the type empty — it's intended purely as a tag for ECS queries and logic.