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::ActionDefinition Struct Reference

The definition of a single action, including whether it represents state or change, whether it supports negative values, and the number of axes it has. More...

#include <input_data.hpp>

Public Member Functions

 ActionDefinition (const QualifiedActionName &contextActionNamePair)
 Construct a new action definition object.
 
 ActionDefinition ()=default
 Construct a new (empty) action definition object.
 
bool operator== (const ActionDefinition &other) const
 Compares two action definitions for equality.
 
bool operator< (const ActionDefinition &other) const
 Provides an implementation of the less than operator, mainly for use by the equality operator.
 
 operator QualifiedActionName () const
 Provides implicit casting from QualifiedActionName.
 

Public Attributes

::std::string mName {}
 The name of the action.
 
InputAttributesType mAttributes {}
 The same as in an InputSource, describes the type of data (normalized) this action is expected to have.
 
ActionValueType mValueType {}
 I'm not yet sure where this is used, since mAttributes already exists.
 
::std::string mContext {}
 The name of the context the action belongs to.
 

Detailed Description

The definition of a single action, including whether it represents state or change, whether it supports negative values, and the number of axes it has.

The only parts of the definition used for comparisons is the action's name and context; its input attributes are mainly used internally, by the InputManager itself.

Constructor & Destructor Documentation

◆ ActionDefinition()

ToyMaker::ActionDefinition::ActionDefinition ( const QualifiedActionName & contextActionNamePair)
inline

Construct a new action definition object.

Parameters
contextActionNamePairThe full name of the action.

Member Function Documentation

◆ operator QualifiedActionName()

ToyMaker::ActionDefinition::operator QualifiedActionName ( ) const
inline

Provides implicit casting from QualifiedActionName.

Returns
QualifiedActionName

◆ operator<()

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

Provides an implementation of the less than operator, mainly for use by the equality operator.

Parameters
otherThe action definition this one is being compared to.
Return values
trueThis one is lesser than the other.
falseThis one is greater than the other.

◆ operator==()

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

Compares two action definitions for equality.

... Just on the basis of their action and context names. Mainly in order to make them a unique key in a map container.

Parameters
otherThe action definition this one is being compared to.
Return values
trueThey're the same;
falseThey're not the same;

Member Data Documentation

◆ mAttributes

InputAttributesType ToyMaker::ActionDefinition::mAttributes {}

The same as in an InputSource, describes the type of data (normalized) this action is expected to have.

Its used mainly internally, by an ActionContext, in order to figure out how to build action data values. This description is defined in some kind of input file.

◆ mValueType

ActionValueType ToyMaker::ActionDefinition::mValueType {}

I'm not yet sure where this is used, since mAttributes already exists.

Todo
Find out where this is used.

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