Update and begin work on a new data model
This commit is contained in:
parent
99546cd0e3
commit
25dfe354ea
2 changed files with 16 additions and 2 deletions
|
|
@ -2,13 +2,15 @@ export class CommonItemData extends foundry.abstract.DataModel {
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
name: fields.HTMLField({
|
name: fields.StringField({
|
||||||
|
initial: ``,
|
||||||
blank: true,
|
blank: true,
|
||||||
trim: true,
|
trim: true,
|
||||||
}),
|
}),
|
||||||
cost: fields.NumberField({
|
cost: fields.NumberField({
|
||||||
|
initial: null,
|
||||||
nullable: true,
|
nullable: true,
|
||||||
})
|
}),
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
12
module/models/DescribedItemData.mjs
Normal file
12
module/models/DescribedItemData.mjs
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
export class DescribedItemData extends CommonItemData {
|
||||||
|
static defineSchema() {
|
||||||
|
const fields = foundry.data.fields;
|
||||||
|
return mergeObject(super.defineSchema(), {
|
||||||
|
description: fields.StringField({
|
||||||
|
initial: ``,
|
||||||
|
blank: true,
|
||||||
|
trim: true,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue