namespace HSchool.Simulation; /// /// The speed buttons the player can pick, as an index on the wire. The table is duplicated in /// src/HSchool.Client/src/net/protocol.ts — indexes, not multipliers, travel over the socket. /// public static class ClockSpeed { /// ×½, ×1, ×2, ×3, ×4. public static ReadOnlySpan Multipliers => [0.5d, 1d, 2d, 3d, 4d]; /// Index of ×1, the speed a school starts at. public const int DefaultIndex = 1; public static int Count => Multipliers.Length; public static bool IsValid(int index) => index >= 0 && index < Multipliers.Length; /// Multiplier for a validated index; out-of-range values fall back to ×1. public static double MultiplierAt(int index) => IsValid(index) ? Multipliers[index] : Multipliers[DefaultIndex]; }