/**
 * Data model pour les personnages joueurs (type "personnage")
 */
export default class PersonnageDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    return {
      // Template biodata
      biodata: new fields.SchemaField({
        age: new fields.NumberField({ initial: 0, integer: true }),
        size: new fields.StringField({ initial: "" }),
        lieunaissance: new fields.StringField({ initial: "" }),
        nationalite: new fields.StringField({ initial: "" }),
        profession: new fields.StringField({ initial: "" }),
        residence: new fields.StringField({ initial: "" }),
        milieusocial: new fields.StringField({ initial: "" }),
        poids: new fields.StringField({ initial: "" }),
        cheveux: new fields.StringField({ initial: "" }),
        sexe: new fields.StringField({ initial: "" }),
        yeux: new fields.StringField({ initial: "" }),
        enfance: new fields.StringField({ initial: "" }),
        adulte: new fields.StringField({ initial: "" }),
        loisirs: new fields.StringField({ initial: "" }),
        singularite: new fields.StringField({ initial: "" }),
        politique: new fields.StringField({ initial: "" }),
        religion: new fields.StringField({ initial: "" }),
        fantastique: new fields.StringField({ initial: "" }),
        description: new fields.HTMLField({ initial: "" }),
        notes: new fields.HTMLField({ initial: "" }),
        gmnotes: new fields.HTMLField({ initial: "" })
      }),
      // Template core
      subactors: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      lamesdestin: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      pointdestin: new fields.NumberField({ initial: 1, integer: true }),
      fluide: new fields.NumberField({ initial: 5, integer: true }),
      mpmb: new fields.NumberField({ initial: 0, integer: true }),
      mpmn: new fields.NumberField({ initial: 0, integer: true }),
      equipementlibre: new fields.HTMLField({ initial: "" }),
      attributs: new fields.SchemaField({
        constitution: new fields.SchemaField({
          label: new fields.StringField({ initial: "Constitution" }),
          abbrev: new fields.StringField({ initial: "constitution" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        physique: new fields.SchemaField({
          label: new fields.StringField({ initial: "Aptitudes Physiques" }),
          abbrev: new fields.StringField({ initial: "physique" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: false }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        culturegenerale: new fields.SchemaField({
          label: new fields.StringField({ initial: "Culture Générale" }),
          abbrev: new fields.StringField({ initial: "culturegenerale" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: false }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        habilite: new fields.SchemaField({
          label: new fields.StringField({ initial: "Habilité" }),
          abbrev: new fields.StringField({ initial: "habilite" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: false }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        perception: new fields.SchemaField({
          label: new fields.StringField({ initial: "Perception" }),
          abbrev: new fields.StringField({ initial: "perception" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: false }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        spiritualite: new fields.SchemaField({
          label: new fields.StringField({ initial: "Spiritualite" }),
          abbrev: new fields.StringField({ initial: "spiritualite" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: false }),
          iscard: new fields.BooleanField({ initial: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        }),
        rationnalite: new fields.SchemaField({
          label: new fields.StringField({ initial: "Rationnalite" }),
          abbrev: new fields.StringField({ initial: "rationnalite" }),
          value: new fields.NumberField({ initial: 0, integer: true }),
          hasmax: new fields.BooleanField({ initial: false }),
          iscard: new fields.BooleanField({ initial: true }),
          max: new fields.NumberField({ initial: 0, integer: true })
        })
      })
    };
  }
}
