diff --git a/source/RulesConfig.mc b/source/RulesConfig.mc new file mode 100644 index 0000000..722a60f --- /dev/null +++ b/source/RulesConfig.mc @@ -0,0 +1,19 @@ +import Toybox.Lang; + +// Configurable padel rules. v1 uses the defaults below; a future settings +// screen will mutate an instance of this class — the engine reads it as-is. +class RulesConfig { + public var goldenPoint as Boolean; // true = sudden death at 40-40 + public var gamesPerSet as Number; // games needed to take a set (before win-by-2) + public var setsToWin as Number; // sets needed to win the match + public var tiebreakEnabled as Boolean; // play a tiebreak at gamesPerSet-all + public var tiebreakTarget as Number; // points needed to win a tiebreak (before win-by-2) + + public function initialize() { + goldenPoint = true; + gamesPerSet = 6; + setsToWin = 2; + tiebreakEnabled = true; + tiebreakTarget = 7; + } +}