1
0
mirror of https://github.com/minetest/minetest.git synced 2025-07-07 10:20:28 +02:00

Cleanup ClientLauncher structure (#10160)

Remove duplicated variables and unify the startup data into a new (inherited) struct.
This commit is contained in:
SmallJoker
2020-07-14 19:10:37 +02:00
committed by GitHub
parent 2bec83eec0
commit 4fa1e03f68
7 changed files with 197 additions and 200 deletions

View File

@ -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; }