Change folder structure, add solution to the root.
This commit is contained in:
29
DaggerFramework/Source/InputAction.cs
Normal file
29
DaggerFramework/Source/InputAction.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
namespace DaggerFramework
|
||||
{
|
||||
public abstract class InputAction
|
||||
{
|
||||
public abstract bool IsDown(InputHandler inputHandler);
|
||||
public abstract bool IsPressed(InputHandler inputHandler);
|
||||
}
|
||||
|
||||
public class KeyInputAction : InputAction
|
||||
{
|
||||
public KeyboardKey Key => _keyboardKey;
|
||||
|
||||
public KeyInputAction(KeyboardKey keyboardKey)
|
||||
{
|
||||
_keyboardKey = keyboardKey;
|
||||
}
|
||||
public override bool IsDown(InputHandler inputHandler)
|
||||
{
|
||||
return inputHandler.IsKeyboardKeyDown(_keyboardKey);
|
||||
}
|
||||
|
||||
public override bool IsPressed(InputHandler inputHandler)
|
||||
{
|
||||
return inputHandler.KeyboardKeyJustPressed(_keyboardKey);
|
||||
}
|
||||
|
||||
private KeyboardKey _keyboardKey;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user