Phase 40: clock tempo at 1 min/s, x5/x10 heavy stride.

This commit is contained in:
Leonid Pershin
2026-08-20 07:02:24 +03:00
parent 2a55a025f4
commit 9199ea36d2
16 changed files with 192 additions and 57 deletions
+20 -2
View File
@@ -6,8 +6,8 @@ namespace HSchool.Simulation;
/// </summary>
public static class ClockSpeed
{
/// <summary>×½, ×1, ×2, ×3, ×4.</summary>
public static ReadOnlySpan<double> Multipliers => [0.5d, 1d, 2d, 3d, 4d];
/// <summary>×½, ×1, ×2, ×5, ×10.</summary>
public static ReadOnlySpan<double> Multipliers => [0.5d, 1d, 2d, 5d, 10d];
/// <summary>Index of ×1, the speed a school starts at.</summary>
public const int DefaultIndex = 1;
@@ -18,4 +18,22 @@ public static class ClockSpeed
/// <summary>Multiplier for a validated index; out-of-range values fall back to ×1.</summary>
public static double MultiplierAt(int index) => IsValid(index) ? Multipliers[index] : Multipliers[DefaultIndex];
/// <summary>
/// Calendar impulses between heavy-system ticks. ×5 and ×10 stride so walking and needs keep
/// one game minute per heavy step instead of twenty tiny ones per second.
/// </summary>
public static int HeavySystemsStride(int speedIndex) => speedIndex switch
{
3 => 4,
4 => 2,
_ => 1,
};
/// <summary>
/// Game minutes passed into presence, needs and learning on a heavy tick. High speeds use a
/// fixed one-minute quantum; lower speeds pass the impulse's own advance.
/// </summary>
public static double HeavyGameMinutes(int speedIndex, double impulseMinutes) =>
speedIndex is 3 or 4 ? 1d : impulseMinutes;
}