refactor: use subclasses for different actor types

This commit is contained in:
Johannes Loher 2022-02-16 13:32:04 +01:00
parent 21f849b464
commit be616e3be8
23 changed files with 321 additions and 240 deletions

View file

@ -2,7 +2,7 @@
//
// SPDX-License-Identifier: MIT
import { DS4Actor } from "./actor/actor";
import { DS4ActorProxy } from "./actor/proxy";
import { getGame } from "./helpers";
let fallbackData: foundry.data.ActorData["data"] | undefined = undefined;
@ -13,7 +13,7 @@ function getFallbackData() {
for (const type of getGame().system.template.Actor?.types ?? []) {
foundry.utils.mergeObject(
fallbackData,
new DS4Actor({ type: type as foundry.data.ActorData["type"], name: "temporary" }).data.data,
new DS4ActorProxy({ type: type as foundry.data.ActorData["type"], name: "temporary" }).data.data,
);
}
}