Persist entity simulation grids in checkpoints
This commit is contained in:
parent
dd21e287f4
commit
f276f9bcb3
7 changed files with 140 additions and 14 deletions
|
|
@ -424,10 +424,25 @@ public static class AetheriaRuntimeCommitLogApplier
|
|||
.ToArray(),
|
||||
WeaponGroups = ToIntArrayArray(entity.WeaponGroups)
|
||||
.Select(group => new AetheriaWeaponGroupSnapshot { EquipmentIndices = group })
|
||||
.ToArray()
|
||||
.ToArray(),
|
||||
StatGrids = ToEntityStatGrids(entity.StatGrids)
|
||||
};
|
||||
}
|
||||
|
||||
private static AetheriaEntityStatGrid[] ToEntityStatGrids(
|
||||
IReadOnlyList<AetheriaRuntimeEntityStatGridCommit>? grids)
|
||||
{
|
||||
return (grids ?? Array.Empty<AetheriaRuntimeEntityStatGridCommit>())
|
||||
.Select(grid => new AetheriaEntityStatGrid
|
||||
{
|
||||
Name = grid.Name ?? "",
|
||||
Width = grid.Width,
|
||||
Height = grid.Height,
|
||||
Values = (grid.Values ?? Array.Empty<double>()).ToArray()
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static int[] ToIntArray(IReadOnlyList<int>? values)
|
||||
{
|
||||
return (values ?? Array.Empty<int>()).ToArray();
|
||||
|
|
|
|||
Loading…
Reference in a new issue