Create the Item data model
This commit is contained in:
parent
cc8f054115
commit
f91c3d2419
5 changed files with 38 additions and 13 deletions
25
module/data/Item/generic.mjs
Normal file
25
module/data/Item/generic.mjs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
export class GenericItemData extends foundry.abstract.TypeDataModel {
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
weight: new fields.NumberField({
|
||||
min: 0,
|
||||
initial: 0,
|
||||
nullable: false,
|
||||
}),
|
||||
quantity: new fields.NumberField({
|
||||
integer: true,
|
||||
min: 0,
|
||||
initial: 1,
|
||||
}),
|
||||
equipped: new fields.BooleanField({
|
||||
initial: true,
|
||||
}),
|
||||
description: new fields.HTMLField({
|
||||
blank: true,
|
||||
trim: true,
|
||||
initial: ``,
|
||||
}),
|
||||
};
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue