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

const fields = foundry.data.fields;

export default class RdDModelArmure extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    return Object.assign({},
      TEMPLATE_DESCRIPTION.fields(),
      TEMPLATE_INVENTAIRE.fields(),
      TEMPLATE_EQUIPEMENT.fields(),
      {
        protection: new fields.StringField({ label: "Protection", initial: "0", ...STRING }),
        deterioration: new fields.NumberField({ label: "Détérioration", initial: 0, ...INTEGER }),
        malus: new fields.NumberField({ label: "Malus", initial: 0, integer: true, required: true, nullable: false }),
      }
    )
  }
}
