Refactor project structure and update documentation. Replace PixiJS with plain DOM for UI rendering, enhance README with game features, and revise protocol documentation for HTTP API. Remove unused files and streamline client code for better maintainability.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
namespace HSchool.Simulation;
|
||||
|
||||
/// <summary>
|
||||
/// The speed buttons the player can pick, as an index on the wire. The table is duplicated in
|
||||
/// <c>src/HSchool.Client/src/net/protocol.ts</c> — indexes, not multipliers, travel over the socket.
|
||||
/// </summary>
|
||||
public static class ClockSpeed
|
||||
{
|
||||
/// <summary>×½, ×1, ×2, ×3, ×4.</summary>
|
||||
public static ReadOnlySpan<double> Multipliers => [0.5d, 1d, 2d, 3d, 4d];
|
||||
|
||||
/// <summary>Index of ×1, the speed a school starts at.</summary>
|
||||
public const int DefaultIndex = 1;
|
||||
|
||||
public static int Count => Multipliers.Length;
|
||||
|
||||
public static bool IsValid(int index) => index >= 0 && index < Multipliers.Length;
|
||||
|
||||
/// <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];
|
||||
}
|
||||
Reference in New Issue
Block a user