using Unity.Entities;
using Unity.NetCode;
namespace ProjectM.Simulation
{
///
/// Predicted per-player ability cooldown gate. Holds the earliest server tick at which the
/// owning player may fire again, so can throttle shots
/// deterministically across client prediction and server simulation.
///
/// Replicated as a so the cooldown survives the frame→tick→rollback
/// boundary: when the client re-predicts ticks after a snapshot, it sees the same authoritative
/// gate the server applied and converges without double-firing. Stored as a raw uint
/// rather than a for simple, quantization-free serialization; compare
/// by wrapping it back into a and using
/// (raw subtraction is unsafe across tick wraparound).
///
///
public struct AbilityCooldown : IComponentData
{
///
/// Raw tick value of the earliest tick the player may fire again. 0 = ready (no
/// cooldown pending). Set by to
/// serverTick + max(1, CooldownTicks) on fire; treat as "still cooling down" only
/// while a valid built from it is newer than the current
/// ServerTick.
///
[GhostField] public uint NextFireTick;
}
}