From 74ff7c3a783e3c111a48715108a5b6a3d25e49b8 Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Sun, 17 Apr 2022 23:23:39 +0200 Subject: Refactor and bugfix --- src/time.h | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'src/time.h') diff --git a/src/time.h b/src/time.h index 4dfa1ff..213615f 100755 --- a/src/time.h +++ b/src/time.h @@ -4,6 +4,7 @@ #include #include #include +#include struct moment{ signed int minutes; @@ -14,7 +15,7 @@ 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; }; struct timeblock{ @@ -22,9 +23,35 @@ struct timeblock{ moment end; }; +struct workday{ + moment call; + moment wrap; + moment planned_wrap; + timeblock blocks[12]; + // + // 1. sleepbreach + // 2. Call + // 3. Early morning + // 4. start of day + // 5. 1st hr overtime + // 6. post-1 hour overtime + // 7. 14-hour mark + // 8. 22:00 + // 9. midnight crossing + // 10. 06:00 + // 11. wrap + // + workday(moment calltime, moment wraptime, moment planned_wraptime) { + + } + workday(moment previous_wrap, moment calltime, moment wraptime, moment planned_wraptime) { + + } +}; + std::string padint(const int input, const int minimum_signs); -timeblock timesplit(timeblock &input_block, const moment splitpoint); +timeblock timesplit(timeblock& input_block, const moment splitpoint); // Splits a timeblock at splitpoint. // It changes the input_block to end at splitpoint, and returns a new timeblock // that lasts from splitpoint to where the input_block used to end. @@ -34,8 +61,8 @@ void wind(moment &input_moment, const int minutes, const int hours, const int da int days_in(const int month, const int year); std::string timeprint(const moment input_moment); - std::string timeprint(const timeblock input_timeblock); +long sortable_time(const timeblock input_timeblock); moment timeinput(const int or_year, const int or_month, const int or_day); moment timeinput(); -- cgit v1.2.1