aboutsummaryrefslogtreecommitdiff
path: root/src/time.h
diff options
context:
space:
mode:
authorSanJacobs2022-04-18 21:56:15 +0200
committerSanJacobs2022-04-18 22:05:49 +0200
commitcbfe467aa2b4bc3b12bd3ab0e31fe6ef74843c64 (patch)
tree0f96b38c8a4bb4f8ff7d37ef94521df43fe6ad36 /src/time.h
parent74ff7c3a783e3c111a48715108a5b6a3d25e49b8 (diff)
downloadsatscalc-cbfe467aa2b4bc3b12bd3ab0e31fe6ef74843c64.tar.gz
satscalc-cbfe467aa2b4bc3b12bd3ab0e31fe6ef74843c64.tar.bz2
satscalc-cbfe467aa2b4bc3b12bd3ab0e31fe6ef74843c64.zip
Implemented delta struct and -operator for momentscpp
THIS IS COMPLETELY UNTESTED THO
Diffstat (limited to 'src/time.h')
-rwxr-xr-xsrc/time.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/time.h b/src/time.h
index 213615f..b512e91 100755
--- a/src/time.h
+++ b/src/time.h
@@ -6,6 +6,12 @@
#include <string.h>
#include <vector>
+struct delta{
+ signed int minutes;
+ signed int hours;
+ signed int days;
+};
+
struct moment{
signed int minutes;
signed int hours; // 24-hour format. 23:59 progresses to 00:00
@@ -16,11 +22,14 @@ struct moment{
bool operator<(const moment& other) const;
bool operator>(const moment& other) const;
bool operator==(const moment& other) const;
+ bool operator!=(const moment& other) const;
+ delta operator-(const moment& other) const;
};
struct timeblock{
moment start;
moment end;
+ double hourcount();
};
struct workday{