From b99fe6cb748be0cf018540180bf19edd1bb1a698 Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Fri, 15 Apr 2022 20:29:24 +0200 Subject: Added padding 0s and made time-system way comfier --- src/time.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/time.h') diff --git a/src/time.h b/src/time.h index 02505a5..f597c2d 100755 --- a/src/time.h +++ b/src/time.h @@ -1,5 +1,8 @@ #pragma once #include +#include +#include +#include struct moment{ signed int minutes; @@ -7,6 +10,10 @@ struct moment{ signed int day; signed int month; signed int year; + + bool operator<(const moment& other) const; + bool operator>(const moment& other) const; + bool operator=(const moment& other) const; }; struct timeblock{ @@ -14,16 +21,14 @@ struct timeblock{ moment end; }; -class day{ - -}; +std::string padint(const int input, const int minimum_signs); -timeblock timesplit(timeblock &input_block, 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. -void wind(moment &input_moment, int minutes, int hours, int days); +void wind(moment &input_moment, const int minutes, const int hours, const int days); int days_in(int month, int year); -- cgit v1.2.1