Luanti 5.11.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 bool isKeyDown (GameKeyType k)
 
virtual bool wasKeyDown (GameKeyType k)
 
virtual bool wasKeyPressed (GameKeyType k)
 
virtual bool wasKeyReleased (GameKeyType k)
 
virtual bool cancelPressed ()
 
virtual float getJoystickSpeed ()
 
virtual float getJoystickDirection ()
 
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 void clearWasKeyPressed ()
 
virtual void clearWasKeyReleased ()
 
virtual void listenForKey (const KeyPress &keyCode)
 
virtual void dontListenForKeys ()
 
virtual void clear ()
 
virtual void releaseAllKeys ()
 

Private Attributes

KeyList keydown
 
v2s32 mousepos
 
v2s32 mousespeed
 
float joystickSpeed
 
float joystickDirection
 

Additional Inherited Members

- Public Attributes inherited from InputHandler
JoystickController joystick
 
KeyCache keycache
 

Constructor & Destructor Documentation

◆ RandomInputHandler()

RandomInputHandler::RandomInputHandler ( )
default

Member Function Documentation

◆ cancelPressed()

virtual bool RandomInputHandler::cancelPressed ( )
inlinevirtual

Implements InputHandler.

◆ getJoystickDirection()

virtual float RandomInputHandler::getJoystickDirection ( )
inlinevirtual

Implements InputHandler.

References joystickDirection.

◆ getJoystickSpeed()

virtual float RandomInputHandler::getJoystickSpeed ( )
inlinevirtual

Implements InputHandler.

References joystickSpeed.

◆ getMousePos()

virtual v2s32 RandomInputHandler::getMousePos ( )
inlinevirtual

Implements InputHandler.

References mousepos.

◆ getMouseWheel()

virtual s32 RandomInputHandler::getMouseWheel ( )
inlinevirtual

Implements InputHandler.

◆ isKeyDown()

virtual bool RandomInputHandler::isKeyDown ( GameKeyType k)
inlinevirtual

◆ 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.

◆ step()

void RandomInputHandler::step ( float dtime)
virtual

Reimplemented from InputHandler.

References RandomInputHandlerSimData::counter, getKeySetting(), joystickDirection, joystickSpeed, keydown, mousepos, mousespeed, Rand(), and KeyList::toggle().

+ 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

◆ joystickDirection

float RandomInputHandler::joystickDirection
private

Referenced by getJoystickDirection(), and step().

◆ joystickSpeed

float RandomInputHandler::joystickSpeed
private

Referenced by getJoystickSpeed(), and step().

◆ keydown

KeyList RandomInputHandler::keydown
private

Referenced by isKeyDown(), 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: