00001 #ifndef _BUFFERED_BOOL_ 00002 #define _BUFFERED_BOOL_ 00003 00004 #include "ClampedNumber.h" 00005 #include "UpdateableNumber.h" 00006 00007 namespace luma 00008 { 00009 namespace numbers 00010 { 00011 00071 class BufferedBool : public UpdateableNumber<bool> 00072 { 00073 private: 00074 float mBottomThreshold; 00075 float mTopThreshold; 00076 ClampedNumber<float> mFloatValue; 00077 bool mBoolValue; 00078 float mFrameTime; 00079 00080 public: 00096 BufferedBool(float bottomThreshold, float topThreshold, float increment = 0.1f); 00097 00102 bool getValue() const; 00103 00108 void setValue(bool value, float ellapsedTime = 1); 00109 00113 void forceValue(bool value); 00114 00119 void setIncrement(float increment); 00120 00125 float getFloatValue() const; 00126 00127 }; 00128 }}//namespace 00129 00130 #endif //_BUFFERED_BOOL_