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.
This commit is contained in:
@@ -10,7 +10,7 @@ public readonly struct LevelTime
|
||||
|
||||
private LevelTime(double seconds) => Seconds = seconds;
|
||||
|
||||
public static LevelTime Of(double seconds) => seconds <= 0
|
||||
? throw new ArgumentOutOfRangeException(nameof(seconds), seconds, "A completion time must be positive.")
|
||||
: new LevelTime(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.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user