logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct GameEntityId

    Stable identifier for a gameplay entity. Immutable value object that supports equality comparison and hashing.

    Implements
    IEquatable<GameEntityId>
    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 GameEntityId : IEquatable<GameEntityId>

    Constructors

    GameEntityId(string)

    Creates a new GameEntityId with the specified identifier.

    Declaration
    public GameEntityId(string value)
    Parameters
    Type Name Description
    string value

    The unique string identifier. Cannot be null.

    Fields

    Value

    The unique string identifier for this entity.

    Declaration
    public readonly string Value
    Field Value
    Type Description
    string

    Properties

    IsValid

    Checks if this GameEntityId has a valid, non-empty value.

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

    Methods

    Equals(GameEntityId)

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

    NewGuid()

    Creates a new GameEntityId with an auto-generated GUID.

    Declaration
    public static GameEntityId NewGuid()
    Returns
    Type Description
    GameEntityId

    A new GameEntityId with a unique GUID-based identifier.

    ToString()

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

    Operators

    operator ==(GameEntityId, GameEntityId)

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

    explicit operator GameEntityId(string)

    Declaration
    public static explicit operator GameEntityId(string value)
    Parameters
    Type Name Description
    string value
    Returns
    Type Description
    GameEntityId

    implicit operator string(GameEntityId)

    Declaration
    public static implicit operator string(GameEntityId id)
    Parameters
    Type Name Description
    GameEntityId id
    Returns
    Type Description
    string

    operator !=(GameEntityId, GameEntityId)

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

    Implements

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