logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct WeaponId

    Stable identifier for a weapon definition. Immutable value object that supports equality comparison and hashing.

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

    Constructors

    WeaponId(string)

    Creates a new WeaponId with the specified identifier.

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

    The unique string identifier. Cannot be null.

    Fields

    Value

    The unique string identifier for this weapon.

    Declaration
    public readonly string Value
    Field Value
    Type Description
    string

    Properties

    IsValid

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

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

    Methods

    Equals(WeaponId)

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

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

    explicit operator WeaponId(string)

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

    implicit operator string(WeaponId)

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

    operator !=(WeaponId, WeaponId)

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

    Implements

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