namespace Godosa.Core.Input; /// Which action a gamepad highlights in an open window (hud spec §4): wraps at the /// ends, stays inside a list that shrinks, −1 when there's nothing to pick. public sealed class MenuCursor { public int Index { get; private set; } = -1; public void Clamp(int count) { if (count <= 0) Index = -1; else if (Index < 0) Index = 0; else if (Index >= count) Index = count - 1; } public void Move(int delta, int count) { if (count <= 0) return; Index = ((Index + delta) % count + count) % count; } }