{
  "$defs": {
    "BoxCondition": {
      "additionalProperties": false,
      "description": "An edge of a range of a box of `hit.json`, told while the state plays.",
      "properties": {
        "box": {
          "$ref": "#/$defs/Id",
          "description": "The box, by the identifier `hit.json` gives it."
        },
        "edge": {
          "$ref": "#/$defs/BoxEdge"
        }
      },
      "required": [
        "box",
        "edge"
      ],
      "type": "object"
    },
    "BoxEdge": {
      "description": "Which end of a range of a box.",
      "enum": [
        "start",
        "end"
      ],
      "type": "string"
    },
    "Condition": {
      "additionalProperties": false,
      "description": "A test of a parameter.",
      "properties": {
        "parameter": {
          "$ref": "#/$defs/Id",
          "description": "The parameter, by its identifier."
        },
        "test": {
          "$ref": "#/$defs/Test"
        },
        "value": {
          "description": "What a number is compared with.",
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "parameter",
        "test"
      ],
      "type": "object"
    },
    "FlowParameter": {
      "additionalProperties": false,
      "description": "A value the game sets and the transitions test.",
      "properties": {
        "default": {
          "description": "The value it has at first: a number, or for a switch 1 for on and 0 for off. A trigger\nstarts unfired.",
          "format": "float",
          "type": "number"
        },
        "id": {
          "$ref": "#/$defs/Id"
        },
        "kind": {
          "$ref": "#/$defs/ParameterKind",
          "default": "number"
        },
        "name": {
          "description": "What the game calls it; each parameter has its own.",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name"
      ],
      "type": "object"
    },
    "FlowState": {
      "additionalProperties": false,
      "description": "A state of the graph: an animation played.",
      "properties": {
        "animation": {
          "$ref": "#/$defs/Id",
          "description": "The animation, by the identifier `rig.json` gives it."
        },
        "at": {
          "default": [
            0.0,
            0.0
          ],
          "description": "Where the Flow workspace draws it, in its own units; a runtime reads past it.",
          "items": {
            "format": "float",
            "type": "number"
          },
          "maxItems": 2,
          "minItems": 2,
          "type": "array"
        },
        "id": {
          "$ref": "#/$defs/Id"
        },
        "name": {
          "description": "Each state has its own name.",
          "type": "string"
        },
        "once": {
          "description": "Played once and held on its last moment, rather than again and again.",
          "type": "boolean"
        },
        "speed": {
          "description": "How fast it is played: 1 at its own pace.",
          "format": "float",
          "type": "number"
        }
      },
      "required": [
        "id",
        "name",
        "animation"
      ],
      "type": "object"
    },
    "FlowTransition": {
      "additionalProperties": false,
      "description": "A way from a state to another.",
      "properties": {
        "at_end": {
          "description": "It waits for the animation of the state it leaves to come to its end: for one that\nloops, the end of a lap.",
          "type": "boolean"
        },
        "box": {
          "anyOf": [
            {
              "$ref": "#/$defs/BoxCondition"
            },
            {
              "type": "null"
            }
          ],
          "description": "It waits for an edge of a range of a box."
        },
        "conditions": {
          "description": "Tests of parameters, which must all hold.",
          "items": {
            "$ref": "#/$defs/Condition"
          },
          "type": "array"
        },
        "event": {
          "description": "It waits for an event of that name, told by the animation.",
          "type": [
            "string",
            "null"
          ]
        },
        "fade": {
          "description": "The seconds the crossfade takes; 0 changes at once.",
          "format": "float",
          "type": "number"
        },
        "from": {
          "anyOf": [
            {
              "$ref": "#/$defs/Id"
            },
            {
              "type": "null"
            }
          ],
          "description": "The state it leaves, by its identifier; none for a transition from any state."
        },
        "id": {
          "$ref": "#/$defs/Id"
        },
        "to": {
          "$ref": "#/$defs/Id",
          "description": "The state it goes to."
        }
      },
      "required": [
        "id",
        "to"
      ],
      "type": "object"
    },
    "FlowVersion": {
      "description": "The versions of the format of graphs.",
      "oneOf": [
        {
          "const": "0.1",
          "description": "The first: parameters, states on animations, transitions on conditions.",
          "type": "string"
        }
      ]
    },
    "Id": {
      "description": "An identifier that never changes: a ULID, 26 letters and digits.",
      "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
      "type": "string"
    },
    "ParameterKind": {
      "description": "What a parameter holds.",
      "oneOf": [
        {
          "const": "number",
          "description": "A number: a speed, a height.",
          "type": "string"
        },
        {
          "const": "switch",
          "description": "On or off: on the ground, crouching.",
          "type": "string"
        },
        {
          "const": "trigger",
          "description": "Fired by the game, spent by the first transition it lets through: jump, attack.",
          "type": "string"
        }
      ]
    },
    "Test": {
      "description": "How a condition tests its parameter.",
      "oneOf": [
        {
          "const": "greater",
          "description": "A number above the value.",
          "type": "string"
        },
        {
          "const": "less",
          "description": "A number under the value.",
          "type": "string"
        },
        {
          "const": "equal",
          "description": "A number equal to the value.",
          "type": "string"
        },
        {
          "const": "not_equal",
          "description": "A number other than the value.",
          "type": "string"
        },
        {
          "const": "on",
          "description": "A switch on.",
          "type": "string"
        },
        {
          "const": "off",
          "description": "A switch off.",
          "type": "string"
        },
        {
          "const": "fired",
          "description": "A trigger fired, and not yet spent.",
          "type": "string"
        }
      ]
    }
  },
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "`flow.json`.",
  "properties": {
    "entry": {
      "anyOf": [
        {
          "$ref": "#/$defs/Id"
        },
        {
          "type": "null"
        }
      ],
      "description": "The state played first, by its identifier; the first state when there is none."
    },
    "format_version": {
      "$ref": "#/$defs/FlowVersion"
    },
    "parameters": {
      "items": {
        "$ref": "#/$defs/FlowParameter"
      },
      "type": "array"
    },
    "states": {
      "items": {
        "$ref": "#/$defs/FlowState"
      },
      "type": "array"
    },
    "transitions": {
      "description": "In the order they are tried: the first that may be taken is.",
      "items": {
        "$ref": "#/$defs/FlowTransition"
      },
      "type": "array"
    }
  },
  "required": [
    "format_version"
  ],
  "title": "pantin flow, format 0.1",
  "type": "object"
}
