logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct HittableSnapshot

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

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

    For an indestructible hittable (IsIndestructible true), RemainingHealth and MaxHealth are both reported as -1, matching the sentinel convention used by Serenity.Hittable.Application.Events.HittableHitSignal.

    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

    The hittable identity.

    Declaration
    public readonly HittableId Id
    Field Value
    Type Description
    HittableId

    IsDestroyed

    Whether this hittable has been destroyed.

    Declaration
    public readonly bool IsDestroyed
    Field Value
    Type Description
    bool

    IsIndestructible

    Whether this hittable can never be destroyed by hits.

    Declaration
    public readonly bool IsIndestructible
    Field Value
    Type Description
    bool

    MaxHealth

    The configured maximum health. -1 when indestructible.

    Declaration
    public readonly int MaxHealth
    Field Value
    Type Description
    int

    RemainingHealth

    The current remaining health, clamped at 0. -1 when indestructible.

    Declaration
    public readonly int RemainingHealth
    Field Value
    Type Description
    int

    Methods

    Equals(HittableSnapshot)

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

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

    operator !=(HittableSnapshot, HittableSnapshot)

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

    Implements

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