summaryrefslogtreecommitdiff
path: root/include/mbgl/style/rotation.hpp
blob: 862ede93b7cdcb1a8fd999e5dd83a508d01c380d (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
#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