diff options
author | SanJacobs | 2022-04-15 20:29:24 +0200 |
---|---|---|
committer | SanJacobs | 2022-04-15 20:29:24 +0200 |
commit | b99fe6cb748be0cf018540180bf19edd1bb1a698 (patch) | |
tree | 58920d2ef71c13bcac2ad99f326bcb3547a85069 /src/time.h | |
parent | bae2d151ab3166bba71904f6538ed9a49273b42d (diff) | |
download | satscalc-b99fe6cb748be0cf018540180bf19edd1bb1a698.tar.gz satscalc-b99fe6cb748be0cf018540180bf19edd1bb1a698.tar.bz2 satscalc-b99fe6cb748be0cf018540180bf19edd1bb1a698.zip |
Added padding 0s and made time-system way comfier
Diffstat (limited to 'src/time.h')
-rwxr-xr-x | src/time.h | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -1,5 +1,8 @@ #pragma once #include <iostream> +#include <sstream> +#include <ios> +#include <iomanip> 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); |