Set scopa targets to their traditional defaults
CI / Build and push docker image (push) Successful in 2m6s

Partnership games go to 21: scopone scientifico (the tournament target)
and scopa a quattro, while two-player scopa keeps its usual 11. The scopa
package resolves the default from the player count and exposes a per
variant options_schema default, so the lobby creation form shows the
right value without frontend changes.
This commit is contained in:
woggioni committed 2026-10-09 14:45:30 +08:00
1 parent 68200bbe62
commit ae7ab5ce60
13 files changed
+94 -30

No files matched your search

+2 -1
View File
@@ -19,7 +19,8 @@ implementation.
- `plugin.py` — `ScoponeEngine(GameEngine)`: the platform-facing adapter.
It translates create/join/websocket actions/deadlines into rules-engine
calls and back, validates the `target_score`/`napola`/`asso_pigliatutto`
creation options, and extracts the `MatchResult` (teams, winner,
creation options (the match target defaults to the traditional 21
points), and extracts the `MatchResult` (teams, winner,
per-player scores and the match summary persisted as the match's JSON
`result`).
@@ -37,7 +37,9 @@ PHASE_PLAYING = "playing"
PHASE_HAND_END = "hand_end"
PHASE_FINISHED = "finished"
DEFAULT_TARGET_SCORE = 11
# The traditional match target for scopone scientifico: the partnership
# game is played to 21 points.
DEFAULT_TARGET_SCORE = 21
def team_of(seat: int) -> int:
@@ -35,7 +35,8 @@ class CreateTest(unittest.TestCase):
session = _session(engine)
self.assertEqual("A", session.players[0].team)
self.assertIsInstance(session.state, ScoponeState)
self.assertEqual(11, session.state.target_score)
# The traditional partnership target.
self.assertEqual(21, session.state.target_score)
self.assertTrue(session.state.napola)
def test_create_options(self) -> None: