Files
przygody-pana-cegly/progression/LevelTime.cs
Gabriel Kaszewski 9767941c65 feat(progression): remaining slice 1 value objects
Lives (floors at zero, exhaustion observable), LevelId, SkillId,
PlaythroughId (never self-generates, keeps tests deterministic),
StatName enum, LevelTime rejects NaN/infinity.

14 tests. Arithmetic/comparison members deferred to the slices whose
behaviour needs them rather than added speculatively.
2026-07-28 18:27:26 +02:00

17 lines
611 B
C#

namespace Mr.BrickAdventures.Progression;
/// <summary>
/// A completion time for one Level. Strictly positive — a zero time means the clock was never
/// running, which is a defect rather than a fast run.
/// </summary>
public readonly struct LevelTime
{
public double Seconds { get; }
private LevelTime(double seconds) => Seconds = seconds;
public static LevelTime Of(double seconds) => double.IsFinite(seconds) && seconds > 0
? new LevelTime(seconds)
: throw new ArgumentOutOfRangeException(nameof(seconds), seconds, "A completion time must be a finite positive number.");
}