Struct HittableSnapshot
Immutable representation of a hittable object's state at a point in time.
Assembly: Serenity.Hittable.Domain.dll
Syntax
public readonly struct HittableSnapshot : IEquatable<HittableSnapshot>
Remarks
Constructors
HittableSnapshot(HittableId, int, int, bool, bool)
Creates a new HittableSnapshot.
Declaration
public HittableSnapshot(HittableId id, int remainingHealth, int maxHealth, bool isIndestructible, bool isDestroyed)
Parameters
| Type |
Name |
Description |
| HittableId |
id |
The hittable identity.
|
| int |
remainingHealth |
The current remaining health.
|
| int |
maxHealth |
The configured maximum health.
|
| bool |
isIndestructible |
Whether this hittable can never be destroyed.
|
| bool |
isDestroyed |
Whether this hittable has been destroyed.
|
Fields
Id
Declaration
public readonly HittableId Id
Field Value
IsDestroyed
Whether this hittable has been destroyed.
Declaration
public readonly bool IsDestroyed
Field Value
IsIndestructible
Whether this hittable can never be destroyed by hits.
Declaration
public readonly bool IsIndestructible
Field Value
MaxHealth
The configured maximum health. -1 when indestructible.
Declaration
public readonly int MaxHealth
Field Value
RemainingHealth
The current remaining health, clamped at 0. -1 when indestructible.
Declaration
public readonly int RemainingHealth
Field Value
Methods
Equals(HittableSnapshot)
Declaration
public bool Equals(HittableSnapshot 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 ==(HittableSnapshot, HittableSnapshot)
Declaration
public static bool operator ==(HittableSnapshot left, HittableSnapshot right)
Parameters
Returns
operator !=(HittableSnapshot, HittableSnapshot)
Declaration
public static bool operator !=(HittableSnapshot left, HittableSnapshot right)
Parameters
Returns
Implements