Work on creating more of the necessary data models

This commit is contained in:
Oliver-Akins 2024-01-15 22:47:47 -07:00
parent ef9a3f2542
commit eb8d4f7c11
8 changed files with 56 additions and 15 deletions

View file

@ -1,13 +1,11 @@
import AspectItem from "./Aspect.mjs";
import SpellItem from "./Spell.mjs";
/**
* @extends {Item}
*/
/** @extends {Item} */
export class ItemHandler extends Item {
/** @override */
proxyTargets = {
aspect: AspectItem,
spell: SpellItem
};
constructor(data, ctx) {
@ -19,6 +17,11 @@ export class ItemHandler extends Item {
return this.proxyTargets[this.type];
};
async migrateSystemData() {
if (!this.fn?.migrateSystemData) return;
this.fn?.migrateSystemData.bind(this)();
};
async proxyFunction(funcName, ...args) {
if (!this.fn?.[funcName]) return;
return await this.fn?.[funcName].bind(this)(...args);

View file

@ -0,0 +1,10 @@
import { ItemHandler } from "./Handler.mjs";
/** @this {ItemHandler} */
async function migrateSystemData() {
this.system
};
export default {
migrateSystemData,
};