Files
Project-M/Assets/_Project/Scripts/Simulation/Persistence/SaveApply.cs
T
kronic f31ffe910b Frontend menu + settings + saves foundation
Netcode frontend pattern: UITK main menu / pause / settings (MenuUi + controllers), on-demand world lifecycle (WorldLauncher/SessionRunner), GameBootstrap menu branch; Graphics/Audio settings (SettingsService/GameVolume); single-slot save foundation (SaveData/SaveService, born-correct load at director spawn, autosave on Siege->Calm + quit); RuntimePanelSettings + theme; BuildTool menu; 10 EditMode tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 15:05:36 -07:00

20 lines
776 B
C#

using Unity.Entities;
namespace ProjectM.Simulation
{
/// <summary>
/// Pure save-apply helpers shared by the server spawn system (born-correct load) and EditMode tests.
/// Burst-safe: unmanaged, non-generic, no enums (avoids the cross-assembly-generic Burst ICE class).
/// </summary>
public static class SaveApply
{
/// <summary>Replace a StorageEntry ledger buffer's contents with a staged PendingSaveLedgerRow buffer.</summary>
public static void WriteLedger(DynamicBuffer<PendingSaveLedgerRow> src, DynamicBuffer<StorageEntry> dest)
{
dest.Clear();
for (int i = 0; i < src.Length; i++)
dest.Add(new StorageEntry { ItemId = src[i].ItemId, Count = src[i].Count });
}
}
}