Luanti 5.17.0-dev
Loading...
Searching...
No Matches
RandomInputHandler Class Referencefinal

#include <inputhandler.h>

Inheritance diagram for RandomInputHandler:
Collaboration diagram for RandomInputHandler:

Public Member Functions

 RandomInputHandler ()=default
bool isRandom () const
virtual float getAxisValue (GameKeyType k)
virtual bool wasKeyDown (GameKeyType k)
virtual bool wasKeyPressed (GameKeyType k)
virtual bool wasKeyReleased (GameKeyType k)
virtual bool cancelPressed ()
virtual v2s32 getMousePos ()
virtual void setMousePos (s32 x, s32 y)
virtual s32 getMouseWheel ()
virtual void step (float dtime)
s32 Rand (s32 min, s32 max)
Public Member Functions inherited from InputHandler
 InputHandler ()
virtual ~InputHandler ()=default
virtual bool isKeyDown (GameKeyType k)
virtual void clearWasKeyPressed ()
virtual void clearWasKeyReleased ()
virtual void reloadKeybindings ()
virtual void clear ()
virtual void releaseAllKeys ()

Private Attributes

std::bitset< GameKeyType::INTERNAL_ENUM_COUNT > keydown
v2s32 mousepos
v2s32 mousespeed

Additional Inherited Members

Static Public Member Functions inherited from InputHandler
static s16 analogToInt (float value)
static float intToAnalog (s16 value)
static void settingChangedCallback (const std::string &name, void *data)

Constructor & Destructor Documentation

◆ RandomInputHandler()

RandomInputHandler::RandomInputHandler ( )
default

Member Function Documentation

◆ cancelPressed()

virtual bool RandomInputHandler::cancelPressed ( )
inlinevirtual

Implements InputHandler.

◆ getAxisValue()

virtual float RandomInputHandler::getAxisValue ( GameKeyType k)
inlinevirtual

Implements InputHandler.

References keydown.

◆ getMousePos()

virtual v2s32 RandomInputHandler::getMousePos ( )
inlinevirtual

Implements InputHandler.

References mousepos.

◆ getMouseWheel()

virtual s32 RandomInputHandler::getMouseWheel ( )
inlinevirtual

Implements InputHandler.

◆ isRandom()

bool RandomInputHandler::isRandom ( ) const
inlinevirtual

Reimplemented from InputHandler.

◆ Rand()

s32 RandomInputHandler::Rand ( s32 min,
s32 max )

References myrand().

Referenced by step().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMousePos()

virtual void RandomInputHandler::setMousePos ( s32 x,
s32 y )
inlinevirtual

Implements InputHandler.

References mousepos, x, and y.

◆ step()

void RandomInputHandler::step ( float dtime)
virtual

Reimplemented from InputHandler.

References KeyType::AUX1, KeyType::DIG, KeyType::FORWARD, KeyType::JUMP, keydown, KeyType::LEFT, mousepos, mousespeed, KeyType::PLACE, and Rand().

Here is the call graph for this function:

◆ wasKeyDown()

virtual bool RandomInputHandler::wasKeyDown ( GameKeyType k)
inlinevirtual

Implements InputHandler.

◆ wasKeyPressed()

virtual bool RandomInputHandler::wasKeyPressed ( GameKeyType k)
inlinevirtual

Implements InputHandler.

◆ wasKeyReleased()

virtual bool RandomInputHandler::wasKeyReleased ( GameKeyType k)
inlinevirtual

Implements InputHandler.

Member Data Documentation

◆ keydown

std::bitset<GameKeyType::INTERNAL_ENUM_COUNT> RandomInputHandler::keydown
private

Referenced by getAxisValue(), and step().

◆ mousepos

v2s32 RandomInputHandler::mousepos
private

Referenced by getMousePos(), setMousePos(), and step().

◆ mousespeed

v2s32 RandomInputHandler::mousespeed
private

Referenced by step().


The documentation for this class was generated from the following files: