From cbfe467aa2b4bc3b12bd3ab0e31fe6ef74843c64 Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Mon, 18 Apr 2022 21:56:15 +0200 Subject: Implemented delta struct and -operator for moments THIS IS COMPLETELY UNTESTED THO --- src/time.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/time.h') 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 #include +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{ -- cgit v1.2.1