Datamodel + Appv2 migration, WIP
This commit is contained in:
22
module/models/feature.mjs
Normal file
22
module/models/feature.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Data model for Feature items
|
||||
*/
|
||||
export default class BoLFeatureDataModel extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
const requiredInteger = { required: true, nullable: false, integer: true };
|
||||
|
||||
return {
|
||||
// Base fields
|
||||
category: new fields.StringField({ initial: null }),
|
||||
subtype: new fields.StringField({ initial: "default" }),
|
||||
description: new fields.HTMLField({ initial: "" }),
|
||||
properties: new fields.SchemaField({}),
|
||||
|
||||
// Feature-specific fields
|
||||
rank: new fields.NumberField({ ...requiredInteger, initial: 0 })
|
||||
};
|
||||
}
|
||||
|
||||
static LOCALIZATION_PREFIXES = ["BOL.Feature"];
|
||||
}
|
||||
Reference in New Issue
Block a user