#!/bin/bash

# Liste des types d'items restants à créer
items=(
  "poison:Poison"
  "prouesse:Prouesse"
  "sortsejdr:Sortsejdr"
  "sortgaldr:Sortgaldr"
  "rune:Rune"
  "armecc:Armecc"
  "armedist:Armedist"
  "armure:Armure"
  "bouclier:Bouclier"
  "equipement:Equipement"
  "monnaie:Monnaie"
  "effetmagique:Effetmagique"
)

for item in "${items[@]}"; do
  type="${item%%:*}"
  class="${item##*:}"
  
  cat > "yggdrasill-${type}-sheet.mjs" << EOF
import YggdrasillItemSheet from "./base-item-sheet.mjs"

export default class Yggdrasill${class}Sheet extends YggdrasillItemSheet {
  /** @override */
  static DEFAULT_OPTIONS = {
    ...super.DEFAULT_OPTIONS,
    classes: [...super.DEFAULT_OPTIONS.classes, "${type}"],
  }

  /** @override */
  static PARTS = {
    main: {
      template: "systems/fvtt-yggdrasill/templates/item-${type}-sheet.hbs",
    },
  }
}
EOF
done

echo "Created all item sheets"
ls -1 yggdrasill-*-sheet.mjs | wc -l
