Calendar: expose time of day (hour/minute)
CI / build-test (push) Successful in 1m7s

Add Hour, Minute and MinuteOfDay to Calendar, decomposing DayProgress into
a 24x60 in-game clock so games can show a date and time, not just the day
number. Covered by a test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Leonid Pershin
2026-06-12 13:09:58 +03:00
co-authored by Claude Opus 4.8
parent 44019a706e
commit 4b91b60f38
2 changed files with 22 additions and 0 deletions
@@ -41,6 +41,19 @@ public class CalendarTests
Assert.Equal(0.5f, calendar.DayProgress, 5);
}
[Fact]
public void HourAndMinute_DecomposeTimeOfDay()
{
var clock = new GameClock();
var calendar = new Calendar(clock, secondsPerDay: 1440f); // one minute per in-game minute
clock.Advance(14 * 60 + 30); // 14:30
Assert.Equal(14, calendar.Hour);
Assert.Equal(30, calendar.Minute);
Assert.Equal(14 * 60 + 30, calendar.MinuteOfDay);
}
[Fact]
public void Pause_DoesNotAdvanceTheCalendar()
{