mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-19 16:24:06 +01:00
Initial
This commit is contained in:
parent
42a705a870
commit
f614456e86
10 changed files with 68 additions and 90 deletions
|
|
@ -8,6 +8,8 @@
|
|||
* @property {boolean} isInventoryItem- Indicates whether items of this type is a Inventory Item
|
||||
*/
|
||||
|
||||
import ItemLinksField from '../fields/itemLinksField.mjs';
|
||||
|
||||
const fields = foundry.data.fields;
|
||||
|
||||
export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
||||
|
|
@ -21,7 +23,8 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
hasDescription: false,
|
||||
hasResource: false,
|
||||
isQuantifiable: false,
|
||||
isInventoryItem: false
|
||||
isInventoryItem: false,
|
||||
isItemLinkable: true
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -69,6 +72,10 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
|
|||
if (this.metadata.isQuantifiable)
|
||||
schema.quantity = new fields.NumberField({ integer: true, initial: 1, min: 0, required: true });
|
||||
|
||||
if (this.metadata.isItemLinkable) {
|
||||
schema.itemLinks = new ItemLinksField();
|
||||
}
|
||||
|
||||
return schema;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue