Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
ToyMaker::InputCombo Struct Reference

An input combo that whose value is recorded and mapped to an (axis of an) action value of some kind. More...

#include <input_data.hpp>

Public Types

enum  Trigger : uint8_t {
  ON_PRESS , ON_RELEASE , ON_CHANGE , ON_BUTTON_PRESS ,
  ON_BUTTON_RELEASE , ON_BUTTON_CHANGE
}
 The action on the main control (provided any modifiers are active) that activates this combo.
 

Public Member Functions

 operator bool () const
 An explicit definition for what set of InputCombo values are considered truthy and which ones are falsey.
 
bool operator== (const InputCombo &other) const
 Compares to InputCombos for equality, for use in certain containers like maps.
 
bool operator< (const InputCombo &other) const
 Mainly supports the equality operator, and allows sorting for InputCombos to work.
 

Public Attributes

InputFilter mMainControl {}
 Axis value corresponding to this combo may be sampled from this control.
 
InputFilter mModifier1 {}
 A single axis of a single input source that must be considered active in order for this combo to be considered active.
 
InputFilter mModifier2 {}
 A single axis of a single input source that must be considered active in order for this combo to be considered active.
 
Trigger mTrigger { ON_CHANGE }
 The actual event on the main control that causes the value mapped to this InputCombo to change.
 
double mDeadzone { 0.f }
 Some device controls, like analog sticks, wear out over time producing false positives for input events. Adjusting this value helps to filter out such false positives.
 
double mThreshold { .7f }
 The threshold (on a main control that produces continuous values, like analog sticks and triggers) beyond which the control is considered pressed, and below which it is considered released.
 

Detailed Description

An input combo that whose value is recorded and mapped to an (axis of an) action value of some kind.

These objects are used to inform the InputManager what inputs are being listened for, how these inputs relate to each other, and what event should trigger an Action update.

At the time of writing, each combo supports one "main control" and two "modifier controls", each of which is taken to be one axis of one control of one device.

After conversion, input from any InputCombo is ultimately mapped to a value between 0 and 1.

Member Function Documentation

◆ operator bool()

ToyMaker::InputCombo::operator bool ( ) const
inline

An explicit definition for what set of InputCombo values are considered truthy and which ones are falsey.

Return values
trueAn input combo corresponding to a real input source;
falseAn input combo which is invalid, and therefore "falsey";

◆ operator<()

bool ToyMaker::InputCombo::operator< ( const InputCombo & other) const
inline

Mainly supports the equality operator, and allows sorting for InputCombos to work.

Parameters
otherThe combo this one is being compared to.
Return values
trueThe combos are equivalent;
falseThe combos are not equivalent;

◆ operator==()

bool ToyMaker::InputCombo::operator== ( const InputCombo & other) const
inline

Compares to InputCombos for equality, for use in certain containers like maps.

Parameters
otherThe combo this one is being compared to.
Return values
trueThe combos are equivalent.
falseThe combos are not equivalent.

Member Data Documentation

◆ mModifier1

InputFilter ToyMaker::InputCombo::mModifier1 {}

A single axis of a single input source that must be considered active in order for this combo to be considered active.

Falsey InputFilters are always considered active.

◆ mModifier2

InputFilter ToyMaker::InputCombo::mModifier2 {}

A single axis of a single input source that must be considered active in order for this combo to be considered active.

Falsey InputFilters are always considered active.


The documentation for this struct was generated from the following file: