Set scopa targets to their traditional defaults
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:
+3
-3
@@ -1125,7 +1125,7 @@ mod tests {
|
||||
"properties": {
|
||||
"target_score": {
|
||||
"type": "integer", "minimum": 1, "maximum": 100,
|
||||
"default": 11,
|
||||
"default": 21,
|
||||
},
|
||||
"napola": {"type": "boolean", "default": true},
|
||||
"asso_pigliatutto": {"type": "boolean", "default": false},
|
||||
@@ -1146,7 +1146,7 @@ mod tests {
|
||||
target.kind,
|
||||
OptionKind::Integer { min: Some(1), max: Some(100) }
|
||||
));
|
||||
assert_eq!(json!(11), target.default);
|
||||
assert_eq!(json!(21), target.default);
|
||||
assert_eq!(OptionKind::Boolean, by_key["napola"].kind);
|
||||
assert_eq!(json!(true), by_key["napola"].default);
|
||||
assert_eq!(OptionKind::Boolean, by_key["asso_pigliatutto"].kind);
|
||||
@@ -1180,7 +1180,7 @@ mod tests {
|
||||
#[test]
|
||||
fn default_options_collect_schema_defaults() {
|
||||
let opts = scopone_game_type().default_options();
|
||||
assert_eq!(Some(&json!(11)), opts.get("target_score"));
|
||||
assert_eq!(Some(&json!(21)), opts.get("target_score"));
|
||||
assert_eq!(Some(&json!(true)), opts.get("napola"));
|
||||
assert_eq!(Some(&json!(false)), opts.get("asso_pigliatutto"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user