import { TEMPLATE_DESCRIPTION } from "../common/_module.mjs";
import { INTEGER, INTEGER_SIGNED, STRING } from "../common/field-types.mjs";

const fields = foundry.data.fields;

export default class RdDModelCompetence extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    return Object.assign({},
      TEMPLATE_DESCRIPTION.fields(),
      {
        niveau: new fields.NumberField({ label: "Niveau", initial: 0, ...INTEGER_SIGNED, min: -11 }),
        default_diffLibre: new fields.NumberField({ label: "Difficulté libre par défaut", initial: 0, ...INTEGER_SIGNED, min: -10, max: 0 }),
        base: new fields.NumberField({ label: "Base", initial: 0, ...INTEGER }),
        categorie: new fields.StringField({ label: "Catégorie", initial: "", ...STRING }),
        xp: new fields.NumberField({ label: "XP", initial: 0, ...INTEGER }),
        defaut_carac: new fields.StringField({ label: "Caractéristique par défaut", initial: "", ...STRING }),
        niveau_archetype: new fields.NumberField({ label: "Niveau d'archétype", initial: 0, ...INTEGER }),
        xp_sort: new fields.NumberField({ label: "XP de sort", initial: 0, ...INTEGER }),
      }
    )
  }
}
