Persist behavior progress in entity snapshots

This commit is contained in:
Meta Vens 2026-06-14 14:08:59 +01:00
commit 3c4fe6fd10
7 changed files with 137 additions and 5 deletions

View file

@ -440,10 +440,26 @@ public static class AetheriaRuntimeCommitLogApplier
.Select(group => new AetheriaWeaponGroupSnapshot { EquipmentIndices = group })
.ToArray(),
StatGrids = ToEntityStatGrids(entity.StatGrids),
ActiveConsumables = ToActiveConsumables(entity.ActiveConsumables)
ActiveConsumables = ToActiveConsumables(entity.ActiveConsumables),
BehaviorProgress = ToBehaviorProgress(entity.BehaviorProgress)
};
}
private static AetheriaBehaviorProgressSnapshot[] ToBehaviorProgress(
IReadOnlyList<AetheriaRuntimeBehaviorProgressCommit>? progress)
{
return (progress ?? Array.Empty<AetheriaRuntimeBehaviorProgressCommit>())
.Select(entry => new AetheriaBehaviorProgressSnapshot
{
OwnerKind = entry.OwnerKind ?? "",
OwnerIndex = entry.OwnerIndex,
BehaviorIndex = entry.BehaviorIndex,
BehaviorKind = entry.BehaviorKind ?? "",
Progress = entry.Progress
})
.ToArray();
}
private static AetheriaActiveConsumableSnapshot[] ToActiveConsumables(
IReadOnlyList<AetheriaRuntimeActiveConsumableCommit>? consumables)
{