aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/NodeTools.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-07-24 09:58:52 +0200
committer GitHub <noreply@github.com>2024-07-24 09:58:52 +0200
commit861acff78bd238232ed9e369ea046c2ed4a31198 (patch)
tree34106af818aa548d7a0ff14b24fbb99617303a7d /src/openvic-simulation/dataloader/NodeTools.hpp
parent6cd55c452d1643666ff4169a89402fd3e3b66c61 (diff)
parenta9a88a481dbae11eddd6c2268014923a955e38c3 (diff)
Merge pull request #179 from OpenVicProject/bookmark-position
Load bookmark position as fvec2_t with height flipped
Diffstat (limited to 'src/openvic-simulation/dataloader/NodeTools.hpp')
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp
index d019cce..945e5e8 100644
--- a/src/openvic-simulation/dataloader/NodeTools.hpp
+++ b/src/openvic-simulation/dataloader/NodeTools.hpp
@@ -589,6 +589,13 @@ namespace OpenVic {
return callback(val);
};
}
+
+ template<typename T>
+ constexpr Callback<T> auto flip_height_callback(Callback<T> auto&& callback, T height) {
+ return [callback, height](T val) -> bool {
+ return callback(height - val);
+ };
+ }
}
}