logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct SpawnHandle

    Opaque reference to a spawned entity instance. Combines an entity reference with the spawn type for tracking.

    Implements
    IEquatable<SpawnHandle>
    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.GameSpawner.Domain.ValueObjects
    Assembly: Serenity.GameSpawner.Domain.dll
    Syntax
    public readonly struct SpawnHandle : IEquatable<SpawnHandle>

    Constructors

    SpawnHandle(GameEntityId, SpawnType)

    Creates a new SpawnHandle for the specified instance and type.

    Declaration
    public SpawnHandle(GameEntityId instanceId, SpawnType type)
    Parameters
    Type Name Description
    GameEntityId instanceId

    The unique instance identity.

    SpawnType type

    The spawn type.

    Fields

    InstanceId

    The unique identity of the spawned instance.

    Declaration
    public readonly GameEntityId InstanceId
    Field Value
    Type Description
    GameEntityId

    Type

    The logical type of the spawned entity.

    Declaration
    public readonly SpawnType Type
    Field Value
    Type Description
    SpawnType

    Properties

    IsValid

    Checks if this handle has a valid instance identity.

    Declaration
    public bool IsValid { get; }
    Property Value
    Type Description
    bool

    Methods

    Create(SpawnType)

    Creates a new SpawnHandle with an auto-generated instance identity.

    Declaration
    public static SpawnHandle Create(SpawnType type)
    Parameters
    Type Name Description
    SpawnType type

    The spawn type.

    Returns
    Type Description
    SpawnHandle

    A new SpawnHandle with a unique instance identity.

    Equals(SpawnHandle)

    Declaration
    public bool Equals(SpawnHandle other)
    Parameters
    Type Name Description
    SpawnHandle other
    Returns
    Type Description
    bool

    Equals(object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int
    Overrides
    ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    ValueType.ToString()

    Operators

    operator ==(SpawnHandle, SpawnHandle)

    Declaration
    public static bool operator ==(SpawnHandle left, SpawnHandle right)
    Parameters
    Type Name Description
    SpawnHandle left
    SpawnHandle right
    Returns
    Type Description
    bool

    operator !=(SpawnHandle, SpawnHandle)

    Declaration
    public static bool operator !=(SpawnHandle left, SpawnHandle right)
    Parameters
    Type Name Description
    SpawnHandle left
    SpawnHandle right
    Returns
    Type Description
    bool

    Implements

    IEquatable<T>
    In this article
    © 2026 Serenity. All Rights Reserved