diff options
Diffstat (limited to 'include/mbgl/style/rotation.hpp')
-rw-r--r-- | include/mbgl/style/rotation.hpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/mbgl/style/rotation.hpp b/include/mbgl/style/rotation.hpp new file mode 100644 index 0000000000..862ede93b7 --- /dev/null +++ b/include/mbgl/style/rotation.hpp @@ -0,0 +1,25 @@ +#pragma once + +namespace mbgl { +namespace style { + +// Could be made a template class if needed +// template <size_t Period> +// size_t period() const noexcept { return Period; } +class Rotation { +public: + Rotation() = default; + Rotation(double angle_) : angle(angle_) {} + double period() const noexcept { return 360.0; } + double getAngle() const noexcept { return angle; } + + friend bool operator==(const Rotation& lhs, const Rotation& rhs) { return lhs.angle == rhs.angle; } + + friend bool operator!=(const Rotation& lhs, const Rotation& rhs) { return !(lhs == rhs); } + +private: + double angle; +}; + +} // namespace style +} // namespace mbgl |