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>
64 lines
3.5 KiB
C#
64 lines
3.5 KiB
C#
using NUnit.Framework;
|
|
using ProjectM.Server;
|
|
using ProjectM.Simulation;
|
|
using Unity.Entities;
|
|
|
|
namespace ProjectM.Tests
|
|
{
|
|
/// <summary>
|
|
/// Guards the ComponentSystemSorter "circular dependency" hazard that is INVISIBLE to the rest of the suite:
|
|
/// every other fixture registers a single system then sorts, so a cross-system [UpdateBefore/After] cycle can
|
|
/// never surface — it only throws at world creation in Play. This registers the REAL ordered server-sim set
|
|
/// (every system that participates in an UpdateBefore/After relation, or its constraint is silently ignored)
|
|
/// into one SimulationSystemGroup and sorts, reproducing the Play-time sort headlessly. Only SortSystems runs
|
|
/// (never Update), so a bare world with no entities/singletons suffices.
|
|
/// </summary>
|
|
public class SystemOrderingCycleTests
|
|
{
|
|
[Test]
|
|
public void RunCycleCombatChain_Sorts_Without_A_Dependency_Cycle()
|
|
{
|
|
using var world = new World("OrderCycleGuard");
|
|
var group = world.GetOrCreateSystemManaged<SimulationSystemGroup>();
|
|
|
|
void Add<T>() where T : unmanaged, ISystem
|
|
=> group.AddSystemToUpdateList(world.GetOrCreateSystem<T>());
|
|
|
|
// RPC-receive systems ordered before the run director
|
|
Add<ReadyToggleSystem>(); Add<RouteSelectSystem>(); Add<PortalInteractReceiveSystem>();
|
|
Add<MetaSpendSystem>(); Add<ClassSelectReceiveSystem>(); Add<BoonApplySystem>(); Add<PrepPurchaseSystem>();
|
|
// Run director + the systems ordered around it (the cycle/siege spine is deleted — LANTERN purge)
|
|
Add<RunDirectorSystem>(); Add<RoomFieldSystem>();
|
|
Add<RoomEnemyDirectorSystem>(); Add<BoonOfferSystem>();
|
|
Add<WaveSystem>();
|
|
// Combat sub-chain in the same group
|
|
Add<EnemyAISystem>(); Add<BossAISystem>();
|
|
Add<EnemyProjectileMoveSystem>(); Add<EnemyProjectileDamageSystem>();
|
|
|
|
Assert.DoesNotThrow(() => group.SortSystems(),
|
|
"A [UpdateBefore/After] cycle in the run/cycle/combat chain throws here instead of only at Play world-creation.");
|
|
}
|
|
|
|
|
|
[Test]
|
|
public void PredictedCombatChain_Sorts_Without_A_Dependency_Cycle()
|
|
{
|
|
// Phase 1.7 added DashTrailDamageSystem ([UpdateAfter(DashSystem)][UpdateBefore(HealthApplyDamageSystem)])
|
|
// and KillRewardSystem ([UpdateAfter(HealthApplyDamageSystem)]) to the predicted combat chain. A cycle in
|
|
// these [UpdateBefore/After] edges is INVISIBLE to per-system fixtures — it only throws at Play world
|
|
// creation. Co-register the chain and sort to reproduce that headlessly (SortSystems only, never Update).
|
|
using var world = new World("OrderCyclePredicted");
|
|
var group = world.GetOrCreateSystemManaged<SimulationSystemGroup>();
|
|
void Add<T>() where T : unmanaged, ISystem
|
|
=> group.AddSystemToUpdateList(world.GetOrCreateSystem<T>());
|
|
|
|
Add<StatRecomputeSystem>(); Add<MeleeComboSystem>(); Add<DashSystem>(); Add<DashTrailDamageSystem>();
|
|
Add<AbilityFireSystem>(); Add<ProjectileMoveSystem>(); Add<ProjectileDamageSystem>();
|
|
Add<HealthApplyDamageSystem>(); Add<KillRewardSystem>();
|
|
|
|
Assert.DoesNotThrow(() => group.SortSystems(),
|
|
"A cycle in the Phase 1.7 predicted combat chain throws here instead of only at Play world-creation.");
|
|
}
|
|
}
|
|
}
|