import { BaseItemDataModel } from "./base-item.mjs"

export default class RaceDataModel extends BaseItemDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    return {
      ...this.defineBaseSchema(),
      size: new fields.NumberField({ initial: 2, integer: true, min: 1, max: 4 }),
      lifeExpectancy: new fields.NumberField({ initial: 50, integer: true, min: 0 }),
      keywords: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      mainTribes: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      language: new fields.StringField({ initial: "" }),
      languageDomains: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      specialRules: new fields.HTMLField({ initial: "" }),
      appearance: new fields.HTMLField({ initial: "" }),
      roleplayHints: new fields.ArrayField(new fields.StringField(), { initial: [] }),
      profiles: new fields.SchemaField({
        artiste: new fields.NumberField({ initial: 0, integer: true }),
        athlete: new fields.NumberField({ initial: 0, integer: true }),
        chasseur: new fields.NumberField({ initial: 0, integer: true }),
        faiseur: new fields.NumberField({ initial: 0, integer: true }),
        forceNature: new fields.NumberField({ initial: 0, integer: true }),
        guerrier: new fields.NumberField({ initial: 0, integer: true }),
        mystique: new fields.NumberField({ initial: 0, integer: true }),
        ombre: new fields.NumberField({ initial: 0, integer: true }),
        savant: new fields.NumberField({ initial: 0, integer: true }),
      }),
    }
  }
}
