refactor: IButtonInputs from Actions to Delegate

This commit is contained in:
Syntriax 2024-09-25 14:36:57 +03:00
parent ef21cdf213
commit 15984bcc06
1 changed files with 6 additions and 4 deletions

View File

@ -4,11 +4,13 @@ namespace Syntriax.Engine.Input;
public interface IButtonInputs<T> : IAssignableStateEnable public interface IButtonInputs<T> : IAssignableStateEnable
{ {
void RegisterOnPress(T button, Action<IButtonInputs<T>, T> callback); void RegisterOnPress(T button, ButtonCallbackDelegate callback);
void UnregisterOnPress(T button, Action<IButtonInputs<T>, T> callback); void UnregisterOnPress(T button, ButtonCallbackDelegate callback);
void RegisterOnRelease(T button, Action<IButtonInputs<T>, T> callback); void RegisterOnRelease(T button, ButtonCallbackDelegate callback);
void UnregisterOnRelease(T button, Action<IButtonInputs<T>, T> callback); void UnregisterOnRelease(T button, ButtonCallbackDelegate callback);
bool IsPressed(T button); bool IsPressed(T button);
bool WasPressed(T button); bool WasPressed(T button);
delegate void ButtonCallbackDelegate(IButtonInputs<T> buttonInputs, T button);
} }