import { SYSTEM } from "../config/system.mjs"
export default class CthulhuEternalArmor extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields
    const schema = {}
    const requiredInteger = { required: true, nullable: false, integer: true }

    schema.description = new fields.HTMLField({ required: true, textSearch: true })
    
    let setting = game.settings.get("fvtt-cthulhu-eternal", "settings-era") || "modern"
    schema.settings = new fields.StringField({ required: true, initial: setting, choices: SYSTEM.AVAILABLE_SETTINGS })

    schema.protection = new fields.NumberField({ ...requiredInteger, required: true, initial: 0, min: 0 })
    schema.resourceLevel = new fields.NumberField({ required: true, initial: 0, min: 0 })
    schema.equipped = new fields.BooleanField({ required: true, initial: false })
    
    return schema
  }

  /** @override */
  static LOCALIZATION_PREFIXES = ["CTHULHUETERNAL.Armor"]
}
