{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/Classiccottrell/isometric-asset-harness/schema/character.schema.json",
  "title": "IGAH character",
  "description": "A customizable character, animal or vehicle. Built into an igah.character/1 sheet: 8 directions × every animation frame of its kind.",
  "type": "object",
  "required": [
    "id"
  ],
  "$defs": {
    "hex": {
      "type": "string",
      "pattern": "^#[0-9a-fA-F]{6}$"
    },
    "styled": {
      "type": "object",
      "properties": {
        "style": {
          "type": "string"
        },
        "color": {
          "$ref": "#/$defs/hex"
        }
      }
    }
  },
  "properties": {
    "$schema": {
      "type": "string"
    },
    "id": {
      "type": "string",
      "pattern": "^[a-z0-9_]+$"
    },
    "name": {
      "type": "string"
    },
    "height": {
      "type": "number",
      "minimum": 0.2,
      "maximum": 1,
      "description": "Tiles; 0.36 matches the scene residents"
    },
    "build": {
      "enum": [
        "slim",
        "average",
        "broad"
      ]
    },
    "skin": {
      "$ref": "#/$defs/hex"
    },
    "hair": {
      "allOf": [
        {
          "$ref": "#/$defs/styled"
        }
      ],
      "properties": {
        "style": {
          "enum": [
            "short",
            "long",
            "bun",
            "mohawk",
            "bald"
          ]
        }
      }
    },
    "hat": {
      "allOf": [
        {
          "$ref": "#/$defs/styled"
        }
      ],
      "properties": {
        "style": {
          "enum": [
            "none",
            "cap",
            "beanie",
            "hard_hat"
          ]
        }
      }
    },
    "top": {
      "allOf": [
        {
          "$ref": "#/$defs/styled"
        }
      ],
      "properties": {
        "style": {
          "enum": [
            "tee",
            "hoodie",
            "jacket",
            "coat",
            "apron",
            "hi_vis",
            "dress"
          ]
        }
      }
    },
    "bottom": {
      "allOf": [
        {
          "$ref": "#/$defs/styled"
        }
      ],
      "properties": {
        "style": {
          "enum": [
            "pants",
            "shorts",
            "skirt"
          ]
        }
      }
    },
    "shoes": {
      "$ref": "#/$defs/hex"
    },
    "accessory": {
      "allOf": [
        {
          "$ref": "#/$defs/styled"
        }
      ],
      "properties": {
        "style": {
          "enum": [
            "none",
            "backpack",
            "shoulder_bag",
            "cane",
            "paint_can",
            "umbrella",
            "box"
          ]
        }
      }
    },
    "face": {
      "allOf": [
        {
          "$ref": "#/$defs/styled"
        }
      ],
      "properties": {
        "style": {
          "enum": [
            "none",
            "glasses",
            "sunglasses",
            "beard",
            "mustache"
          ]
        }
      }
    },
    "kind": {
      "enum": [
        "person",
        "dog",
        "bird",
        "vehicle"
      ],
      "description": "What it is. Defaults to person. Each kind has its own options; see the spec."
    },
    "size": {
      "enum": [
        "small",
        "medium",
        "large"
      ],
      "description": "dog"
    },
    "ears": {
      "enum": [
        "floppy",
        "pointy"
      ],
      "description": "dog"
    },
    "tail": {
      "enum": [
        "long",
        "short",
        "curled"
      ],
      "description": "dog"
    },
    "species": {
      "enum": [
        "pigeon",
        "sparrow",
        "crow",
        "gull"
      ],
      "description": "bird"
    },
    "style": {
      "enum": [
        "hatchback",
        "sedan",
        "van",
        "pickup"
      ],
      "description": "vehicle"
    },
    "coat": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "markings": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "collar": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "body": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "wings": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "paint": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "extras": {
      "$ref": "#/$defs/styled",
      "description": "dog, bird or vehicle slot: { style, color }"
    },
    "nose": {
      "$ref": "#/$defs/hex"
    },
    "head": {
      "$ref": "#/$defs/hex"
    },
    "beak": {
      "$ref": "#/$defs/hex"
    },
    "glass": {
      "$ref": "#/$defs/hex"
    }
  }
}
