import { TEMPLATE_DESCRIPTION, TEMPLATE_INVENTAIRE } from "../common/_module.mjs";
import { CommonAppreciable } from "../common/appreciable.mjs";
import { STRING } from "../common/field-types.mjs";

const fields = foundry.data.fields;
const TEMPLATE_APPRECIABLE = new CommonAppreciable();

export default class RdDModelNourritureBoisson extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    return Object.assign({},
      TEMPLATE_DESCRIPTION.fields(),
      TEMPLATE_INVENTAIRE.fields(),
      TEMPLATE_APPRECIABLE.fields(),
      {
        sust: new fields.NumberField({ label: "Sustentation", initial: 0, integer: true, required: true, nullable: false }),
        exotisme: new fields.NumberField({ label: "Exotisme", initial: 0, integer: true, required: true, nullable: false, min: -10, max: 0 }),
        cuisinier: new fields.StringField({ label: "Cuisinier", initial: "", ...STRING }),
        boisson: new fields.BooleanField({ label: "Boisson", initial: false }),
        desaltere: new fields.NumberField({ label: "Désaltère", initial: 0, integer: true, required: true, nullable: false }),
        alcoolise: new fields.BooleanField({ label: "Alcoolisée", initial: false }),
        force: new fields.NumberField({ label: "Force alcool", initial: 0, integer: true, required: true, nullable: false, min: -10, max: 0 }),
      }
    )
  }
}
