mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-04-30 02:31:41 -04:00
33 lines
905 B
JavaScript
33 lines
905 B
JavaScript
import {EntitySheetHelper} from "./helper.js";
|
|
|
|
/**
|
|
* Extend the base Item document to support attributes and groups with a custom template creation dialog.
|
|
* @extends {Item}
|
|
*/
|
|
export class SimpleItem extends Item {
|
|
|
|
/** @inheritdoc */
|
|
prepareDerivedData() {
|
|
super.prepareDerivedData();
|
|
this.system.groups = this.system.groups || {};
|
|
this.system.attributes = this.system.attributes || {};
|
|
EntitySheetHelper.clampResourceValues(this.system.attributes);
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
/** @override */
|
|
static async createDialog(data={}, options={}) {
|
|
return EntitySheetHelper.createDialog.call(this, data, options);
|
|
}
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
/**
|
|
* Is this Item used as a template for other Items?
|
|
* @type {boolean}
|
|
*/
|
|
get isTemplate() {
|
|
return !!this.getFlag("worldbuilding", "isTemplate");
|
|
}
|
|
}
|