logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct WeaponSnapshot

    Immutable representation of a weapon's state at a point in time.

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

    Constructors

    WeaponSnapshot(WeaponId, int, int, FireMode, bool, bool)

    Creates a new WeaponSnapshot.

    Declaration
    public WeaponSnapshot(WeaponId id, int currentAmmo, int maxCapacity, FireMode fireMode, bool isTriggerPressed, bool isReloading)
    Parameters
    Type Name Description
    WeaponId id

    The weapon identity.

    int currentAmmo

    The current ammo count.

    int maxCapacity

    The max magazine capacity.

    FireMode fireMode

    The fire mode.

    bool isTriggerPressed

    Whether the trigger is pressed.

    bool isReloading

    Whether the weapon is reloading.

    Fields

    CurrentAmmo

    The current ammo count in the magazine.

    Declaration
    public readonly int CurrentAmmo
    Field Value
    Type Description
    int

    FireMode

    The current fire mode.

    Declaration
    public readonly FireMode FireMode
    Field Value
    Type Description
    FireMode

    Id

    The weapon identity.

    Declaration
    public readonly WeaponId Id
    Field Value
    Type Description
    WeaponId

    IsReloading

    Whether the weapon is currently reloading.

    Declaration
    public readonly bool IsReloading
    Field Value
    Type Description
    bool

    IsTriggerPressed

    Whether the trigger is currently pressed.

    Declaration
    public readonly bool IsTriggerPressed
    Field Value
    Type Description
    bool

    MaxCapacity

    The maximum magazine capacity.

    Declaration
    public readonly int MaxCapacity
    Field Value
    Type Description
    int

    Properties

    IsEmpty

    Whether the magazine is empty.

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

    Methods

    Equals(WeaponSnapshot)

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

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

    operator !=(WeaponSnapshot, WeaponSnapshot)

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

    Implements

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