#ifndef DISCRETEANGLE_H #define DISCRETEANGLE_H #include "Angle.h" #include "Range.h" namespace Passer { namespace LinearAlgebra { // A fixed angle between (-180..180] template class AngleUsing { public: AngleUsing(T sourceValue) { this->value = sourceValue; } AngleUsing(float f); float ToFloat() const; inline T GetValue() const { return this->value; } AngleUsing operator+(const AngleUsing a) { AngleUsing r = AngleUsing((float)this->value + a.value); return r; } inline AngleUsing operator+=(const AngleUsing a) { return this->value + a.value; } inline AngleUsing operator-(const AngleUsing a) { return this->value - a.value; } inline AngleUsing operator-() { this->value = -this->value; return *this; } inline bool operator==(const AngleUsing a) { return this->value == a.value; } // protected: T value; }; } // namespace LinearAlgebra } // namespace Passer using namespace Passer::LinearAlgebra; #endif