logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Class CharacterSnapshot

    Immutable snapshot of a character's generic state. Contains only character-level data (identity, status, health). Specialized character types (e.g., Character) inherit from this class to add their own fields. Uses a class instead of a struct to support inheritance.

    Inheritance
    object
    CharacterSnapshot
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Serenity.Character.Domain.ValueObjects
    Assembly: Serenity.Character.Domain.dll
    Syntax
    public class CharacterSnapshot

    Constructors

    CharacterSnapshot(CharacterId, CharacterStatus, int, int)

    Creates a new CharacterSnapshot.

    Declaration
    public CharacterSnapshot(CharacterId id, CharacterStatus status, int remainingHealth, int maxHealth)
    Parameters
    Type Name Description
    CharacterId id

    Character identity.

    CharacterStatus status

    Current lifecycle status.

    int remainingHealth

    Remaining hit points.

    int maxHealth

    Maximum hit points.

    Fields

    Id

    The character identity (reuses CharacterId from Serenity.Character).

    Declaration
    public readonly CharacterId Id
    Field Value
    Type Description
    CharacterId

    MaxHealth

    Maximum hit points.

    Declaration
    public readonly int MaxHealth
    Field Value
    Type Description
    int

    RemainingHealth

    Remaining hit points.

    Declaration
    public readonly int RemainingHealth
    Field Value
    Type Description
    int

    Status

    Current lifecycle status.

    Declaration
    public readonly CharacterStatus Status
    Field Value
    Type Description
    CharacterStatus

    Methods

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string
    Overrides
    object.ToString()
    In this article
    © 2026 Serenity. All Rights Reserved