Struct WeaponSnapshot
Immutable representation of a weapon's state at a point in time.
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
FireMode
Declaration
public readonly FireMode FireMode
Field Value
Id
Declaration
public readonly WeaponId Id
Field Value
IsReloading
Whether the weapon is currently reloading.
Declaration
public readonly bool IsReloading
Field Value
IsTriggerPressed
Whether the trigger is currently pressed.
Declaration
public readonly bool IsTriggerPressed
Field Value
MaxCapacity
The maximum magazine capacity.
Declaration
public readonly int MaxCapacity
Field Value
Properties
IsEmpty
Whether the magazine is empty.
Declaration
public bool IsEmpty { get; }
Property Value
Methods
Equals(WeaponSnapshot)
Declaration
public bool Equals(WeaponSnapshot other)
Parameters
Returns
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| object |
obj |
|
Returns
Overrides
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
ToString()
Declaration
public override string ToString()
Returns
Overrides
Operators
operator ==(WeaponSnapshot, WeaponSnapshot)
Declaration
public static bool operator ==(WeaponSnapshot left, WeaponSnapshot right)
Parameters
Returns
operator !=(WeaponSnapshot, WeaponSnapshot)
Declaration
public static bool operator !=(WeaponSnapshot left, WeaponSnapshot right)
Parameters
Returns
Implements