110 - Class Data Model (#111)

* Added PreCreate/Create/Delete logic for Class/Subclass and set it as foreignUUID fields in PC

* Moved methods into TypedModelData

* Simplified Subclass
This commit is contained in:
WBHarry 2025-06-07 20:30:12 +02:00 committed by GitHub
parent 53be047e12
commit 746e0f239a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 190 additions and 224 deletions

View file

@ -1,21 +1,12 @@
export default class DhpItem extends Item {
_preCreate(data, changes, user) {
super._preCreate(data, changes, user);
}
prepareData() {
super.prepareData();
if (this.type === 'class') {
// Bad. Make this better.
// this.system.domains = CONFIG.daggerheart.DOMAIN.classDomainMap[Object.keys(CONFIG.daggerheart.DOMAIN.classDomainMap).find(x => x === this.name.toLowerCase())];
}
}
/**
* @inheritdoc
* @param {object} options - Options which modify the getRollData method.
* @returns
* @returns
*/
getRollData(options = {}) {
let data;