// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. #nullable disable using System.Collections.Generic; namespace osu.Game.Screens.Play { public partial class KeyCounterAction : KeyCounter.Trigger where T : struct { public T Action { get; } public KeyCounterAction(T action) : base($"B{(int)(object)action + 1}") { Action = action; } public bool OnPressed(T action, bool forwards) { if (!EqualityComparer.Default.Equals(action, Action)) return false; Lit(forwards); return false; } public void OnReleased(T action, bool forwards) { if (!EqualityComparer.Default.Equals(action, Action)) return; Unlit(forwards); } } }