aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharlie Blake2018-07-18 22:31:39 +0100
committerCharlie Blake2018-07-18 22:31:39 +0100
commite0cbfc79cd1c8e6133cf9b0fa59ed32ba75a90c2 (patch)
tree2143bfd3dc9ac26df5131ee7b938e2df84f56534 /src
parentMerge pull request #77 from thecharlesblake/add-accordion (diff)
downloadmetasol-e0cbfc79cd1c8e6133cf9b0fa59ed32ba75a90c2.tar.gz
metasol-e0cbfc79cd1c8e6133cf9b0fa59ed32ba75a90c2.zip

Canfield rules schema and update default rules

Diffstat (limited to 'src')
-rw-r--r--src/main/input-output/input/json-parsing/rules_parser.cpp32
-rw-r--r--src/main/input-output/input/sol_preset_types.cpp6
2 files changed, 32 insertions, 6 deletions
diff --git a/src/main/input-output/input/json-parsing/rules_parser.cpp b/src/main/input-output/input/json-parsing/rules_parser.cpp
index b70abdf..f7de6d8 100644
--- a/src/main/input-output/input/json-parsing/rules_parser.cpp
+++ b/src/main/input-output/input/json-parsing/rules_parser.cpp
@@ -462,6 +462,9 @@ string rules_parser::rules_schema_json() {
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "JSON Schema representing a generic solitaire game",
+ "definitions": {
+ "rank": {"type": "string", "pattern": "^(([0-9]|1[0-3]|a|A|j|J|q|Q|k|K))$"},
+ },
"type": "object",
"properties": {
"tableau piles": {
@@ -485,15 +488,24 @@ string rules_parser::rules_schema_json() {
"enum": [
"any",
"no-build",
- "kings"
+ "kings",
+ "auto-reserve"
]
},
"diagonal deal": {
"type": "boolean"
},
- "move built group": {
+ "wraps": {
"type": "boolean"
},
+ "move built group": {
+ "type": "string",
+ "enum": [
+ "yes",
+ "no",
+ "whole-pile"
+ ]
+ },
"move built group policy": {
"type": "string",
"enum": [
@@ -520,8 +532,20 @@ string rules_parser::rules_schema_json() {
"present": {
"type": "boolean"
},
- "initial card": {
- "type": "boolean"
+ "initial cards": {
+ "type": "string",
+ "enum": [
+ "none",
+ "one",
+ "all"
+ ]
+ },
+ "base card": {
+ "type": "string",
+ "oneOf":[
+ {"$ref": "#/definitions/rank"},
+ {"type": "string","enum": ["random"]}
+ ]
},
"removable": {
"type": "boolean"
diff --git a/src/main/input-output/input/sol_preset_types.cpp b/src/main/input-output/input/sol_preset_types.cpp
index 0c96651..65100e0 100644
--- a/src/main/input-output/input/sol_preset_types.cpp
+++ b/src/main/input-output/input/sol_preset_types.cpp
@@ -25,13 +25,15 @@ map<string, string> sol_preset_types::mp = {
"build policy": "any-suit",
"spaces policy": "any",
"diagonal deal": false,
- "move built group": false,
+ "wraps": false,
+ "move built group": "no",
"move built group policy": "same-as-build",
"face up cards": "all"
},
"foundations": {
"present": true,
- "initial card": false,
+ "initial cards": "none",
+ "base card": "A",
"removable": false,
"only complete pile moves": false
},