three bug-encoding invariants, one red/green cycle each: - Coins.TrySubtract fails instead of clamping - LevelTime rejects zero (continued-run zero best-times) - SkillLevel has no zero (unowned is absence, not Level=1) plan: drop signed NetCoins; add Attempt outcome as idempotency guard
17 lines
600 B
C#
17 lines
600 B
C#
namespace Mr.BrickAdventures.Progression;
|
|
|
|
/// <summary>
|
|
/// How far a Skill has been upgraded. Starts at one; there is no zero, because a Playthrough
|
|
/// records only the Skills it owns and absence from that record is what "unowned" means.
|
|
/// </summary>
|
|
public readonly struct SkillLevel
|
|
{
|
|
public int Value { get; }
|
|
|
|
private SkillLevel(int value) => Value = value;
|
|
|
|
public static SkillLevel Of(int value) => value < 1
|
|
? throw new ArgumentOutOfRangeException(nameof(value), value, "A skill level starts at 1; unowned is absence, not level 0.")
|
|
: new SkillLevel(value);
|
|
}
|