Game Scene Split up

This commit is contained in:
2026-06-04 13:45:46 -07:00
parent dbc4a92a86
commit 16b01bec38
49 changed files with 11976 additions and 188 deletions
@@ -13,8 +13,8 @@ namespace ProjectM.Tests
/// transit). A bare world is seeded with an <c>ExpeditionGate</c> (+ LocalTransform) and a player
/// (RegionTag + LocalTransform + PlayerTag). A player whose region matches the gate's FromRegion and who is
/// within the gate radius is transited (RegionTag flipped + LocalTransform teleported to ArrivalPos).
/// Returning to base during the Expedition phase caps the cycle phase timer. Pins the proximity gate, the
/// region/radius guards, and the early-return phase cap.
/// Returning to base signals the ThreatDirector (the post-expedition retaliation source) exactly once. Pins
/// the proximity gate, the region/radius guards, and the return signal.
/// </summary>
public class ExpeditionGateSystemTests
{
@@ -101,22 +101,24 @@ namespace ProjectM.Tests
}
[Test]
public void Return_To_Base_During_Expedition_Caps_The_Phase_Timer()
public void Return_To_Base_Signals_ThreatDirector_Once()
{
var (world, group) = MakeWorld("GateReturnCapWorld");
var (world, group) = MakeWorld("GateReturnSignalWorld");
using (world)
{
var em = world.EntityManager;
MakeGate(em, new float3(0, 1, 0), RegionId.Expedition, RegionId.Base, radius: 15f, arrival: new float3(0, 1, 0));
MakePlayer(em, new float3(3, 1, 0), RegionId.Expedition);
var cycle = em.CreateEntity(typeof(CycleState));
em.SetComponentData(cycle, new CycleState { Phase = CyclePhase.Expedition, PhaseEndTick = 5000, CycleNumber = 1 });
var threat = em.CreateEntity(typeof(ThreatState));
em.SetComponentData(threat, new ThreatState());
group.Update();
Assert.AreEqual(1u, em.GetComponentData<CycleState>(cycle).PhaseEndTick,
"Returning to base mid-Expedition caps PhaseEndTick to 1 so Defend starts next tick.");
var ts = em.GetComponentData<ThreatState>(threat);
Assert.AreEqual(1, ts.PendingReturns,
"Returning to base signals the ThreatDirector exactly once (the gate teleports the returner out of its radius).");
Assert.AreEqual(1, ts.ExpeditionsCompleted, "A completed expedition is counted.");
}
}
}