From 91da6f9429174b64071faa2d88bb01819ab50e07 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 3 Jan 2024 23:28:42 +0100 Subject: indent view schema --- rules.js | 73 ++++++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/rules.js b/rules.js index afb281d..03e1d4b 100644 --- a/rules.js +++ b/rules.js @@ -114,37 +114,50 @@ exports.action = function (state, player, action, arg) { // JSON Schema for view data exports.VIEW_SCHEMA = { type: "object", - properties: { - log: {type: "array", items: {type: "string"}}, - prompt: {type: "string"}, - scenario: {type: "integer"}, - - dice: {type: "array", minItems: 24, maxItems: 24, items: {type: "integer", minimum: -1}}, - sticks: {type: "array", items: {type: "integer", minimum: 0}}, - cubes: {type: "array", items: {type: "integer", minimum: 0}}, - - morale: {type: "array", minItems: 2, maxItems: 2, items: {type: "integer", minimum: 0}}, - tv1: {type: "integer", minimum: 0}, - tv2: {type: "integer", minimum: 0}, - front: {type: "array", items: {type: "array", items: {type: "integer", minimum: 0}}}, - reserve: {type: "array", items: {type: "array", items: {type: "integer", minimum: 0}}}, - - selected: {type: "integer", minimum: -1}, - target: {type: "integer", minimum: -1}, - hits: {type: "integer", minimum: 0}, - self: {type: "integer", minimum: 0}, - - shift: {type: "array", items: {type: "integer", minimum: 0}}, - target2: {type: "integer", minimum: 0}, - hits2: {type: "integer", minimum: 0}, - - actions: {type: "object"}, - }, - required: [ - "log", "prompt", "scenario", "dice", "sticks", "cubes", "morale", "tv1", "tv2", - "front", "reserve", "selected", "target", "hits", "self" + properties: { + log: { type: "array", items: { type: "string" } }, + prompt: { type: "string" }, + scenario: { type: "integer" }, + + dice: { type: "array", minItems: 24, maxItems: 24, items: { type: "integer", minimum: -1 } }, + sticks: { type: "array", items: { type: "integer", minimum: 0 } }, + cubes: { type: "array", items: { type: "integer", minimum: 0 } }, + + morale: { type: "array", minItems: 2, maxItems: 2, items: { type: "integer", minimum: 0 } }, + tv1: { type: "integer", minimum: 0 }, + tv2: { type: "integer", minimum: 0 }, + front: { type: "array", items: { type: "array", items: { type: "integer", minimum: 0 } } }, + reserve: { type: "array", items: { type: "array", items: { type: "integer", minimum: 0 } } }, + + selected: { type: "integer", minimum: -1 }, + target: { type: "integer", minimum: -1 }, + hits: { type: "integer", minimum: 0 }, + self: { type: "integer", minimum: 0 }, + + shift: { type: "array", items: { type: "integer", minimum: 0 } }, + target2: { type: "integer", minimum: 0 }, + hits2: { type: "integer", minimum: 0 }, + + actions: { type: "object" }, + }, + required: [ + "log", + "prompt", + "scenario", + "dice", + "sticks", + "cubes", + "morale", + "tv1", + "tv2", + "front", + "reserve", + "selected", + "target", + "hits", + "self", ], - additionalProperties: false + additionalProperties: false, } exports.view = function (state, player) { -- cgit v1.2.3