aboutsummaryrefslogtreecommitdiffstats
path: root/src/rfps_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/rfps_utils.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rfps_utils.cpp b/src/rfps_utils.cpp
new file mode 100644
index 0000000..c595a21
--- /dev/null
+++ b/src/rfps_utils.cpp
@@ -0,0 +1,16 @@
+#include "rfps_utils.h"
+
+namespace utils {
+// unused, for now :^}
+int min(const int& v1, const int& v2) {
+ return v1 >= v2 ? v2 : v1;
+}
+
+int max(const int& v1, const int& v2) {
+ return v1 >= v2 ? v1 : v2;
+}
+
+int clamp(const int& v, const int& v1, const int& v2) {
+ return v >= v1 ? (v <= v2 ? v : v2) : v1;
+}
+} // namespace utils