UI/UiSound.cs

Static helper that exposes two UI sounds, Hover and Click, and routes them through GameAudio.Current.Play with configured per-sound gaps so controls share throttling and consistent sound behavior.

namespace Coilgarden;

/// <summary>
/// The two sounds every interactive control in the UI shares: a hover tick and a click knock.
/// <para>
/// Routed through <see cref="GameAudio.Current"/> rather than each panel calling
/// <see cref="Sound.Play(string)"/> directly, so every control in the game sounds identical and
/// obeys the same per-sound throttle <see cref="GameAudio"/> already has - a cursor dragged
/// across a row of buttons fires a hover on each one, and without the floor that reads as a
/// buzz rather than as feedback.
/// </para>
/// <para>
/// A plain static class rather than a type declared inside a panel's own <c>@code</c> block:
/// s&amp;box's Razor generates a render-tree checksum per component, and a type that only
/// exists inside one component's code-behind is not always something that checksum can
/// substitute - which throws every frame rather than failing to compile.
/// </para>
/// </summary>
public static class UiSound
{
	public static void Hover() => GameAudio.Current?.Play( GameSounds.UiHover, GameConfig.UiHoverSoundGap );

	public static void Click() => GameAudio.Current?.Play( GameSounds.UiClick, GameConfig.UiClickSoundGap );
}