Files
Project-M/Assets/_Project/Scripts/Simulation/Player/PlayerReady.cs
T
2026-07-02 20:41:43 -07:00

21 lines
1.0 KiB
C#

using Unity.Entities;
using Unity.NetCode;
namespace ProjectM.Simulation
{
/// <summary>
/// The player's expedition ready-check flag — a plain send-to-all <c>[GhostField]</c> byte on the player ghost so
/// EVERY client can render the "N/M READY" staging panel (owner-only would hide teammates' readiness). Written
/// server-only by <c>ReadyToggleSystem</c> from the <see cref="ReadyToggleRequest"/> RPC — honored during Staging
/// AND the Launching countdown (an un-ready during the countdown is the launch-abort escape hatch); cleared for
/// all players by <c>RunDirectorSystem</c> on the Returning edge. The N/M derivation counts live PlayerTag ghosts,
/// which is valid ONLY because the party is co-located at base while Staging (the co-location invariant — N7);
/// ready toggles are refused in every other lifecycle state.
/// </summary>
public struct PlayerReady : IComponentData
{
/// <summary>1 = ready to launch; 0 = not ready.</summary>
[GhostField] public byte Value;
}
}