Game.Notifications.DisallowCluster
Assembly: Assembly-CSharp
Namespace: Game.Notifications
Type: struct
Base: System.ValueType
Implements: IComponentData, IQueryTypeParameter, IEmptySerializable
Summary:
DisallowCluster is an empty marker/tag ECS component used by the game's notification/cluster logic to mark an entity as "disallowed" for cluster-related operations. The struct is intentionally empty but annotated with [StructLayout(LayoutKind.Sequential, Size = 1)] to ensure a non-zero size for serialization and binary compatibility. It implements IComponentData so it can be stored on entities, IQueryTypeParameter to be usable in entity queries, and IEmptySerializable to participate in the game's Colossal serialization system.
Fields
- This struct contains no managed instance fields.
The StructLayout attribute with Size = 1 ensures the type occupies at least one byte in memory/binary layout, which is useful for serialization and native interop despite being an otherwise empty marker type.
Properties
- None. This is a pure marker component and exposes no properties.
Constructors
public DisallowCluster()
(implicit default)
The parameterless constructor is provided by the C# compiler for structs. No initialization is required because the type carries no data.
Methods
- None. The type provides no methods; it serves only as a tag.
Usage Example
// Add the tag to an entity using an EntityManager
entityManager.AddComponentData(entity, new Game.Notifications.DisallowCluster());
// Using an EntityCommandBuffer (common in jobs or deferred operations)
commandBuffer.AddComponent(entityInCommandBufferIndex, new Game.Notifications.DisallowCluster());
// Query entities that have this tag
Entities
.WithAll<Game.Notifications.DisallowCluster>()
.ForEach((Entity e) => {
// handle entities that are marked as disallowed for cluster operations
}).Schedule();
// Remove the tag when no longer needed
entityManager.RemoveComponent<Game.Notifications.DisallowCluster>(entity);
Notes: - Because this is a marker component, it is typically used only to convey presence/absence in queries or conditional logic — no payload is stored. - The IEmptySerializable implementation and StructLayout attribute ensure the component is compatible with the game's serialization systems and native layout expectations.