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.
Inherited Members
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 |