aboutsummaryrefslogtreecommitdiffstats
path: root/include/mbgl/style/rotation.hpp
blob: 30adfb8d5076287b5ccdf37051b494f715abf006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#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