aboutsummaryrefslogtreecommitdiff
path: root/src/client/inputhandler.h
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2020-07-14 19:10:37 +0200
committerGitHub <noreply@github.com>2020-07-14 19:10:37 +0200
commit4fa1e03f6844a24fc4b37f22e7264957b2a71d06 (patch)
tree0de95205bbe4b2123d87583a5e9639817b39824c /src/client/inputhandler.h
parent2bec83eec0dc2de2d6b8fb0b827e94807ed9b0b8 (diff)
downloadhax-minetest-server-4fa1e03f6844a24fc4b37f22e7264957b2a71d06.tar.gz
hax-minetest-server-4fa1e03f6844a24fc4b37f22e7264957b2a71d06.zip
Cleanup ClientLauncher structure (#10160)
Remove duplicated variables and unify the startup data into a new (inherited) struct.
Diffstat (limited to 'src/client/inputhandler.h')
-rw-r--r--src/client/inputhandler.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/inputhandler.h b/src/client/inputhandler.h
index 9be2a2ed4..fc7998f20 100644
--- a/src/client/inputhandler.h
+++ b/src/client/inputhandler.h
@@ -219,6 +219,11 @@ public:
virtual ~InputHandler() = default;
+ virtual bool isRandom() const
+ {
+ return false;
+ }
+
virtual bool isKeyDown(GameKeyType k) = 0;
virtual bool wasKeyDown(GameKeyType k) = 0;
virtual bool cancelPressed() = 0;
@@ -372,6 +377,11 @@ class RandomInputHandler : public InputHandler
public:
RandomInputHandler() = default;
+ bool isRandom() const
+ {
+ return true;
+ }
+
virtual bool isKeyDown(GameKeyType k) { return keydown[keycache.key[k]]; }
virtual bool wasKeyDown(GameKeyType k) { return false; }
virtual bool cancelPressed() { return false; }