logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct GameEntityRef

    Lightweight reference to a gameplay entity, combining identity and semantic kind. Passed across systems to identify participants without coupling to entity internals.

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

    Constructors

    GameEntityRef(GameEntityId, GameEntityKind)

    Creates a new GameEntityRef with the specified identity and kind.

    Declaration
    public GameEntityRef(GameEntityId id, GameEntityKind kind)
    Parameters
    Type Name Description
    GameEntityId id

    The entity identity.

    GameEntityKind kind

    The entity kind.

    Fields

    Id

    The unique identity of the referenced entity.

    Declaration
    public readonly GameEntityId Id
    Field Value
    Type Description
    GameEntityId

    Kind

    The semantic kind of the referenced entity.

    Declaration
    public readonly GameEntityKind Kind
    Field Value
    Type Description
    GameEntityKind

    Properties

    IsValid

    Checks if this reference has a valid entity identity.

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

    Methods

    Equals(GameEntityRef)

    Declaration
    public bool Equals(GameEntityRef other)
    Parameters
    Type Name Description
    GameEntityRef 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 ==(GameEntityRef, GameEntityRef)

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

    operator !=(GameEntityRef, GameEntityRef)

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

    Implements

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