12345678910111213141516171819202122232425262728293031323334353637 |
- #pragma once
-
-
- #include "ILifeCycle.h"
-
- template<class T>
- class IInput
- : public ILifeCycle
- {
- public:
- const T& getValue() const
- {
- return m_lastValue;
- }
-
- bool hasChanged() const
- {
- return m_hasChanged;
- }
-
- protected:
- void setValue(const T& value)
- {
- if (value != m_lastValue)
- {
- m_hasChanged = true;
- m_lastValue = value;
- }
- else if (m_hasChanged)
- {
- m_hasChanged = false;
- }
- }
-
- T m_lastValue;
- bool m_hasChanged;
- };
|