| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include <mbgl/util/chrono.hpp> |
| 4 | #include <mbgl/util/optional.hpp> |
| 5 | |
| 6 | namespace mbgl { |
| 7 | namespace style { |
| 8 | |
| 9 | class TransitionOptions { |
| 10 | public: |
| 11 | optional<Duration> duration; |
| 12 | optional<Duration> delay; |
| 13 | |
| 14 | TransitionOptions(optional<Duration> duration_ = {}, |
| 15 | optional<Duration> delay_ = {}) |
| 16 | : duration(std::move(duration_)), |
| 17 | delay(std::move(delay_)) {} |
| 18 | |
| 19 | TransitionOptions reverseMerge(const TransitionOptions& defaults) const { |
| 20 | return { |
| 21 | duration ? duration : defaults.duration, |
| 22 | delay ? delay : defaults.delay |
| 23 | }; |
| 24 | } |
| 25 | |
| 26 | bool isDefined() const { |
| 27 | return duration || delay; |
| 28 | } |
| 29 | }; |
| 30 | |
| 31 | } // namespace style |
| 32 | } // namespace mbgl |
| 33 |
