/**
 * Data model pour les talents
 */
export default class TalentDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    return {
      description: new fields.HTMLField({ initial: "" }),
      isautomated: new fields.BooleanField({ initial: false }),
      automations: new fields.ArrayField(
        new fields.SchemaField({
          id: new fields.StringField({ initial: "" }),
          eventtype: new fields.StringField({ initial: "on-drop" }),
          name: new fields.StringField({ initial: "" }),
          bonusname: new fields.StringField({ initial: "vigueur" }),
          bonus: new fields.NumberField({ initial: 0, integer: true }),
          competence: new fields.StringField({ initial: "" }),
          minLevel: new fields.NumberField({ initial: 0, integer: true }),
          baCost: new fields.NumberField({ initial: 0, integer: true })
        }),
        { initial: [] }
      ),
      talenttype: new fields.StringField({ initial: "" }),
      utilisation: new fields.StringField({ initial: "" }),
      prerequis: new fields.StringField({ initial: "" }),
      resumebonus: new fields.StringField({ initial: "" }),
      used: new fields.BooleanField({ initial: false })
    };
  }
}
