Merge branch 'master' into 004_equipment_tracking

This commit is contained in:
Gesina Schwalbe 2020-12-29 23:09:16 +01:00
commit f2724a13a1
6 changed files with 12 additions and 7 deletions

View file

@ -9,7 +9,7 @@ interface DS4ActorDataAttributes {
mind: ExtensibleData<number>;
}
interface ExtensibleData<T extends any> {
interface ExtensibleData<T> {
initial: T;
}

View file

@ -1,3 +1,4 @@
import { DS4ItemDataType } from "../item/item-data";
import { DS4Actor } from "./actor";
import { DS4ActorDataType } from "./actor-data";
@ -5,7 +6,7 @@ import { DS4ActorDataType } from "./actor-data";
* Extend the basic ActorSheet with some very simple modifications
* @extends {ActorSheet}
*/
export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor> {
export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4ItemDataType> {
/**
* This method returns the data for the template of the actor sheet.
* It explicitly adds the items of the object sorted by type in the
@ -88,7 +89,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor> {
data: data,
};
// Remove the type from the dataset since it's in the itemData.type prop.
delete itemData.data["type"];
delete itemData.data.type;
// Finally, create the item!
return this.actor.createOwnedItem(itemData);

View file

@ -1,10 +1,12 @@
import { DS4Item } from "../item/item";
import { DS4ItemDataType } from "../item/item-data";
import { DS4ActorDataType } from "./actor-data";
/**
* Extend the base Actor entity by defining a custom roll data structure which is ideal for the Simple system.
* @extends {Actor}
*/
export class DS4Actor extends Actor<DS4ActorDataType> {
export class DS4Actor extends Actor<DS4ActorDataType, DS4ItemDataType, DS4Item> {
/** @override */
prepareDerivedData(): void {
const data = this.data;