InputCommon: Allow controller settings specified with input expresions.

This commit is contained in:
Jordan Woyak 2019-10-18 14:54:02 -05:00
parent 6a857df219
commit e8152b700f
13 changed files with 172 additions and 28 deletions

View file

@ -7,6 +7,7 @@
#include <memory>
#include "InputCommon/ControlReference/ExpressionParser.h"
#include "InputCommon/ControlReference/FunctionExpression.h"
#include "InputCommon/ControllerInterface/Device.h"
// ControlReference
@ -30,6 +31,9 @@ public:
virtual ControlState State(const ControlState state = 0) = 0;
virtual bool IsInput() const = 0;
template <typename T>
T GetState();
int BoundCount() const;
ciface::ExpressionParser::ParseStatus GetParseStatus() const;
void UpdateReference(ciface::ExpressionParser::ControlEnvironment& env);
@ -45,6 +49,18 @@ protected:
ciface::ExpressionParser::ParseStatus m_parse_status;
};
template <>
inline bool ControlReference::GetState<bool>()
{
return State() > ciface::ExpressionParser::CONDITION_THRESHOLD;
}
template <typename T>
T ControlReference::GetState()
{
return State();
}
//
// InputReference
//