b34945c2d2
Deletes CyclePhaseSystem, GoalReachedSystem, CoreDamage/CoreRestore, ThreatDirector, CoreIntegrity/GoalProgress/RunPhase/RunOutcome/ThreatState components, CoreVisualFeedbackSystem, and the whole Client/Onboarding slice (+6 test files). Keepers reworked: RunDirectorSystem (UpdateBefore attr + launch guard + goal/threat bank removed; sole SaveRequest raiser now), CycleDirectorSpawnSystem (ledger/meta host only), WaveSystem UNGATED (waves run wherever a WaveDirector is baked), EnemyAISystem core-fallback stripped, AmbientAudioSystem reworked (bed + run cues; no CycleState gate), MusicSystem RunInfo-only, HudSystem big trim (goal meter, core bar, siege banner, terminal banner, outcome flash, onboarding hook all gone), MetaShop/ClassPrep/AimReticle siege gates dropped, DebugOverlay/ops re-meant (SpawnWave=force next wave, EndSiege=quiet arena; SetCalm/AdvanceGoal/SetHeat retired, bytes reserved), TuningConfig Core knobs retired (ids 20-23 reserved), StorageMath.DrainFraction deleted, HowToPlay copy rewritten. Save epoch v7 (fresh epoch, operator-approved): SaveData drops goal/core/outcome + conveyor/machine-IO fields; MinLoadableVersion=7; PendingSave/PendingStructure trimmed; RollTerminalCampaignForward deleted; SaveStructureScan signature slimmed. 390 tests green; Play world-creation clean (player + waves live, no exceptions). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
34 lines
1.7 KiB
C#
34 lines
1.7 KiB
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 });
|
|
}
|
|
|
|
/// <summary>EB-1: map a serialized <see cref="StructureSave"/> to the staged <see cref="PendingStructure"/>
|
|
/// (the menu->ServerWorld copy in WorldLauncher). Pure so the field-for-field copy — including the
|
|
/// easy-to-miss HP — is unit-tested; an omitted field here silently restores every structure at full HP.</summary>
|
|
/// <summary>EB-1: map a serialized <see cref="StructureSave"/> to the staged <see cref="PendingStructure"/>
|
|
/// (the menu->ServerWorld copy in WorldLauncher). Pure so the field-for-field copy — including the
|
|
/// easy-to-miss HP — is unit-tested; an omitted field here silently restores every structure at full HP.</summary>
|
|
public static PendingStructure ToPending(in StructureSave s) => new PendingStructure
|
|
{
|
|
Type = s.Type,
|
|
CellX = s.CellX,
|
|
CellZ = s.CellZ,
|
|
HP = s.HP,
|
|
};
|
|
}
|
|
}
|