From 80362dbf454bb4bc5b19deb438b7c485240ef367 Mon Sep 17 00:00:00 2001 From: San Jacobs Date: Thu, 20 Jul 2023 22:48:01 +0200 Subject: Fractions come in pairs now --- src/time.odin | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/time.odin') 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, } -- cgit v1.2.1