Persist behavior runtime state in checkpoints
This commit is contained in:
parent
f98f650ab5
commit
16a92b0173
8 changed files with 311 additions and 6 deletions
|
|
@ -442,10 +442,40 @@ public static class AetheriaRuntimeCommitLogApplier
|
|||
StatGrids = ToEntityStatGrids(entity.StatGrids),
|
||||
ActiveConsumables = ToActiveConsumables(entity.ActiveConsumables),
|
||||
BehaviorProgress = ToBehaviorProgress(entity.BehaviorProgress),
|
||||
WeaponStates = ToWeaponStates(entity.WeaponStates)
|
||||
WeaponStates = ToWeaponStates(entity.WeaponStates),
|
||||
BehaviorStates = ToBehaviorStates(entity.BehaviorStates)
|
||||
};
|
||||
}
|
||||
|
||||
private static AetheriaBehaviorStateSnapshot[] ToBehaviorStates(
|
||||
IReadOnlyList<AetheriaRuntimeBehaviorStateCommit>? states)
|
||||
{
|
||||
return (states ?? Array.Empty<AetheriaRuntimeBehaviorStateCommit>())
|
||||
.Select(state => new AetheriaBehaviorStateSnapshot
|
||||
{
|
||||
OwnerKind = state.OwnerKind ?? "",
|
||||
OwnerIndex = state.OwnerIndex,
|
||||
BehaviorIndex = state.BehaviorIndex,
|
||||
BehaviorKind = state.BehaviorKind ?? "",
|
||||
Pinging = state.Pinging,
|
||||
PingCooldown = state.PingCooldown,
|
||||
PingLerp = state.PingLerp,
|
||||
PingRadius = state.PingRadius,
|
||||
PingedEntityCount = state.PingedEntityCount,
|
||||
RadiatorTemperature = state.RadiatorTemperature,
|
||||
Emissivity = state.Emissivity,
|
||||
PumpedHeat = state.PumpedHeat,
|
||||
WasteHeat = state.WasteHeat,
|
||||
EnergyUsage = state.EnergyUsage,
|
||||
ReactorDraw = state.ReactorDraw,
|
||||
ReactorLoadRatio = state.ReactorLoadRatio,
|
||||
CapacitorCharge = state.CapacitorCharge,
|
||||
CapacitorCapacity = state.CapacitorCapacity,
|
||||
CapacitorEfficiency = state.CapacitorEfficiency
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
private static AetheriaWeaponStateSnapshot[] ToWeaponStates(
|
||||
IReadOnlyList<AetheriaRuntimeWeaponStateCommit>? states)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue