From e9693380d952552319b2cdd3f183e2e676676f95 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Mon, 23 Oct 2017 22:01:18 +0100 Subject: Add deal file parsing and verifying --- resources/input-file-schema.json | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 resources/input-file-schema.json (limited to 'resources/input-file-schema.json') diff --git a/resources/input-file-schema.json b/resources/input-file-schema.json new file mode 100644 index 0000000..2086eb0 --- /dev/null +++ b/resources/input-file-schema.json @@ -0,0 +1,35 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "definitions": { + "card": { + "type": "string", + "pattern": "^(?i)([A|[1-9]|1[0-3]|J|Q|K])([C|D|H|S])$" + } + }, + "type": "object", + "properties": { + "tableau piles": { + "type": "array", + "items": { + "type": "array", + "items": { + "$ref": "#/definitions/card" + } + } + }, + "hole cards": { + "type": "array", + "items": { + "$ref": "#/definitions/card" + } + } + }, + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "tableau piles" + ] + } + ] +} \ No newline at end of file -- cgit v1.2.1 From c5e5d9d6bbd7d7d2a6c6463505e7b7031e846ebf Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Tue, 24 Oct 2017 01:23:00 +0100 Subject: Draft of OO game logic --- resources/input-file-schema.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'resources/input-file-schema.json') diff --git a/resources/input-file-schema.json b/resources/input-file-schema.json index 2086eb0..1b55e4f 100644 --- a/resources/input-file-schema.json +++ b/resources/input-file-schema.json @@ -17,11 +17,8 @@ } } }, - "hole cards": { - "type": "array", - "items": { - "$ref": "#/definitions/card" - } + "hole card": { + "$ref": "#/definitions/card" } }, "additionalProperties": false, -- cgit v1.2.1