/**
 * Data model for Vehicle actors
 */
export default class BoLVehicleDataModel extends foundry.abstract.TypeDataModel {
  static defineSchema() {
    const fields = foundry.data.fields;
    const requiredInteger = { required: true, nullable: false, integer: true };
    
    return {
      vehicletype: new fields.StringField({ initial: "boat" }),
      
      attributes: new fields.SchemaField({
        hull: new fields.SchemaField({
          key: new fields.StringField({ initial: "hull" }),
          label: new fields.StringField({ initial: "BOL.attributes.hull" }),
          value: new fields.NumberField({ ...requiredInteger, initial: 0 }),
          min: new fields.NumberField({ ...requiredInteger, initial: 0 }),
          max: new fields.NumberField({ ...requiredInteger, initial: 5 })
        }),
        crew: new fields.SchemaField({
          key: new fields.StringField({ initial: "crew" }),
          label: new fields.StringField({ initial: "BOL.attributes.crew" }),
          value: new fields.NumberField({ ...requiredInteger, initial: 0 }),
          min: new fields.NumberField({ ...requiredInteger, initial: 0 }),
          max: new fields.NumberField({ ...requiredInteger, initial: 5 })
        }),
        resources: new fields.SchemaField({
          key: new fields.StringField({ initial: "resources" }),
          label: new fields.StringField({ initial: "BOL.attributes.resources" }),
          value: new fields.NumberField({ ...requiredInteger, initial: 0 }),
          min: new fields.NumberField({ ...requiredInteger, initial: 0 }),
          max: new fields.NumberField({ ...requiredInteger, initial: 5 })
        })
      }),
      
      row: new fields.SchemaField({
        key: new fields.StringField({ initial: "row" }),
        label: new fields.StringField({ initial: "BOL.attributes.row" }),
        value: new fields.NumberField({ ...requiredInteger, initial: 0 }),
        min: new fields.NumberField({ ...requiredInteger, initial: 0 }),
        max: new fields.NumberField({ ...requiredInteger, initial: 5 })
      }),
      
      spur: new fields.SchemaField({
        value: new fields.StringField({ initial: "" })
      }),
      
      status: new fields.SchemaField({}),
      
      description: new fields.HTMLField({ initial: "" })
    };
  }

  static LOCALIZATION_PREFIXES = ["BOL.Vehicle"];
}
