const fields = foundry.data.fields;

export default class VehiculeData extends foundry.abstract.TypeDataModel {

    static defineSchema() {
        return {
            name: new fields.StringField({ required: false, blank: false, trim: true }),
            skillId: new fields.StringField({ required: false, initial: "", blank: true, trim: true }),
            speed: new fields.SchemaField({
                cruise: new fields.StringField({ required: false, initial: "Slow", blank: true }),
                maximum: new fields.StringField({ required: false, initial: "Medium", blank: true })
            }),
            agility: new fields.NumberField({ required: false, min: 0, integer: true }),
            crew: new fields.NumberField({ required: false, min: 0, integer: true }),
            passengers: new fields.NumberField({ required: false, min: 0, integer: true }),
            cargo: new fields.NumberField({ required: false, min: 0, integer: false }),
            life: new fields.SchemaField({
                value: new fields.NumberField({ required: true, initial: 0, integer: true }),
                max: new fields.NumberField({ required: true, initial: 0, integer: true })
            }),
            shipping: new fields.NumberField({ required: false, min: 0, integer: true }),
            cost: new fields.NumberField({ required: false, min: 0, integer: true }),
            armor: new fields.SchemaField({
                front: new fields.NumberField({ required: true, initial: 0, integer: true }),
                rear: new fields.NumberField({ required: true, initial: 0, integer: true }),
                sides: new fields.NumberField({ required: true, initial: 0, integer: true })
            }),
            skills: new fields.SchemaField({
                autopilot: new fields.NumberField({ required: true, initial: 0, integer: true })
            })
        };
    }
}
