aboutsummaryrefslogtreecommitdiff
path: root/src/time.odin
diff options
context:
space:
mode:
authorSan Jacobs2023-07-20 22:48:01 +0200
committerSan Jacobs2023-07-20 22:48:01 +0200
commit80362dbf454bb4bc5b19deb438b7c485240ef367 (patch)
treed2f49177855d72e2a4c66a944643d0ca6a9d503a /src/time.odin
parent50ff7b2e4fb5902f87b80e95f40f76ab45bc6a70 (diff)
downloadsatscalc-80362dbf454bb4bc5b19deb438b7c485240ef367.tar.gz
satscalc-80362dbf454bb4bc5b19deb438b7c485240ef367.tar.bz2
satscalc-80362dbf454bb4bc5b19deb438b7c485240ef367.zip
Fractions come in pairs now
Diffstat (limited to 'src/time.odin')
-rw-r--r--src/time.odin24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/time.odin b/src/time.odin
index 080096b..44c810a 100644
--- a/src/time.odin
+++ b/src/time.odin
@@ -42,6 +42,12 @@ Timeblock :: struct {
reason : string,
}
+Fractionpair :: struct {
+ start : f32,
+ end : f32,
+}
+
+
Workday :: struct {
call : Moment,
wrap : Moment,
@@ -52,16 +58,14 @@ Workday :: struct {
// cause more blocks
blocks : [16]Timeblock,
- // Fractions store how far
- // through the day each
- // timesplit occurs.
- // They should probably be
- // changed to come in pairs,
- // as moments do in timeblocks,
- // because then we can store
- // both the start and end
- // of timeblocks in fractions
- fractions : [16]f32,
+ // Fractions store how long
+ // since the workday's
+ // preceding midnight
+ // a timesplit occurs.
+ // They're pairs so they
+ // can exactly map to each
+ // timeblock's start and end
+ fractions : [16]Fractionpair,
total_timeblocks : int,
}