Skip to content

Game.Events.Flood

Assembly: Game (in-game assembly, may also appear in Assembly-CSharp)
Namespace: Game.Events

Type: struct

Base: System.ValueType

Summary:
Flood is a marker/tag ECS component used to represent a flood event in the game's entity-component-system. It is an empty (no-data) component that implements IComponentData for use with Unity.Entities, IQueryTypeParameter to allow use as a query parameter type, and IEmptySerializable to participate in the game's custom serialization. The StructLayout attribute with Size = 1 ensures the struct has a non-zero size for serialization/interop reasons.


Fields

  • None.
    This struct declares no instance fields — it is used purely as a tag/marker component.

Properties

  • None.

Constructors

  • public Flood() (implicit)
    As a value type, Flood has the default parameterless constructor provided by the runtime. No custom constructors are defined.

Methods

  • None.
    No methods are defined on this struct.

Usage Example

// Add Flood as a tag component to an entity
var entityManager = World.DefaultGameObjectInjectionWorld.EntityManager;
var floodEntity = entityManager.CreateEntity(typeof(Game.Events.Flood));

// Or add the component to an existing entity
entityManager.AddComponent<Game.Events.Flood>(someEntity);

// Querying for entities that have the Flood tag in a SystemBase
public partial class FloodHandlingSystem : SystemBase
{
    protected override void OnUpdate()
    {
        Entities
            .WithAll<Game.Events.Flood>()
            .ForEach((Entity e) =>
            {
                // Handle flood event for entity e
            })
            .WithoutBurst()
            .Run();
    }
}

{{ This tag component is intended for lightweight signaling within ECS: use it when you only need to mark entities as "in a flood state" or to trigger flood-related systems, without attaching payload data. The IEmptySerializable interface and StructLayout(Size = 1) are present to ensure correct serialization and compatibility with the game's custom entity serialization pipeline. }}