Persist weapon runtime state in checkpoints
This commit is contained in:
parent
3c4fe6fd10
commit
f98f650ab5
10 changed files with 287 additions and 8 deletions
|
|
@ -441,10 +441,38 @@ public static class AetheriaRuntimeCommitLogApplier
|
|||
.ToArray(),
|
||||
StatGrids = ToEntityStatGrids(entity.StatGrids),
|
||||
ActiveConsumables = ToActiveConsumables(entity.ActiveConsumables),
|
||||
BehaviorProgress = ToBehaviorProgress(entity.BehaviorProgress)
|
||||
BehaviorProgress = ToBehaviorProgress(entity.BehaviorProgress),
|
||||
WeaponStates = ToWeaponStates(entity.WeaponStates)
|
||||
};
|
||||
}
|
||||
|
||||
private static AetheriaWeaponStateSnapshot[] ToWeaponStates(
|
||||
IReadOnlyList<AetheriaRuntimeWeaponStateCommit>? states)
|
||||
{
|
||||
return (states ?? Array.Empty<AetheriaRuntimeWeaponStateCommit>())
|
||||
.Select(state => new AetheriaWeaponStateSnapshot
|
||||
{
|
||||
OwnerKind = state.OwnerKind ?? "",
|
||||
OwnerIndex = state.OwnerIndex,
|
||||
BehaviorIndex = state.BehaviorIndex,
|
||||
BehaviorKind = state.BehaviorKind ?? "",
|
||||
Firing = state.Firing,
|
||||
Ammo = state.Ammo,
|
||||
BurstRemaining = state.BurstRemaining,
|
||||
BurstTimer = state.BurstTimer,
|
||||
BurstInterval = state.BurstInterval,
|
||||
CooldownProgress = state.CooldownProgress,
|
||||
CoolingDown = state.CoolingDown,
|
||||
Charging = state.Charging,
|
||||
Charged = state.Charged,
|
||||
Charge = state.Charge,
|
||||
Reloading = state.Reloading,
|
||||
ReloadProgress = state.ReloadProgress,
|
||||
AmmoIntervalProgress = state.AmmoIntervalProgress
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static AetheriaBehaviorProgressSnapshot[] ToBehaviorProgress(
|
||||
IReadOnlyList<AetheriaRuntimeBehaviorProgressCommit>? progress)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue