InputCommon: Extract ControlReference from ControllerInterface

Better separation of concerns. Relegates `ControllerInterface` to
enumerating input controls, and the new `ControlReference` deals with
combining inputs and configuration expression parsing.
This commit is contained in:
Michael Maltese
2016-10-11 17:48:38 -07:00
parent f621a6af43
commit a509f56116
15 changed files with 274 additions and 282 deletions

View File

@ -42,8 +42,6 @@ public:
public:
virtual std::string GetName() const = 0;
virtual ~Control() {}
bool InputGateOn();
virtual Input* ToInput() { return nullptr; }
virtual Output* ToOutput() { return nullptr; }
};
@ -59,15 +57,6 @@ public:
// things like absolute axes/ absolute mouse position will override this
virtual bool IsDetectable() { return true; }
virtual ControlState GetState() const = 0;
ControlState GetGatedState()
{
if (InputGateOn())
return GetState();
else
return 0.0;
}
Input* ToInput() override { return this; }
};
@ -81,13 +70,6 @@ public:
public:
virtual ~Output() {}
virtual void SetState(ControlState state) = 0;
void SetGatedState(ControlState state)
{
if (InputGateOn())
SetState(state);
}
Output* ToOutput() override { return this; }
};