refactor: use subclasses for different item types
This commit is contained in:
parent
be616e3be8
commit
8d2cff77d7
47 changed files with 766 additions and 456 deletions
13
src/item/armor/armor-data-properties.ts
Normal file
13
src/item/armor/armor-data-properties.ts
Normal file
|
@ -0,0 +1,13 @@
|
|||
// SPDX-FileCopyrightText: 2022 Johannes Loher
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { DS4ItemDataPropertiesDataRollable } from "../item-data-properties-base";
|
||||
import { DS4ArmorDataSourceData } from "./armor-data-source";
|
||||
|
||||
export interface DS4ArmorDataProperties {
|
||||
type: "armor";
|
||||
data: DS4ArmorDataPropertiesData;
|
||||
}
|
||||
|
||||
interface DS4ArmorDataPropertiesData extends DS4ArmorDataSourceData, DS4ItemDataPropertiesDataRollable {}
|
25
src/item/armor/armor-data-source.ts
Normal file
25
src/item/armor/armor-data-source.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
// SPDX-FileCopyrightText: 2022 Johannes Loher
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { DS4 } from "../../config";
|
||||
import {
|
||||
DS4ItemDataSourceDataBase,
|
||||
DS4ItemDataSourceDataEquipable,
|
||||
DS4ItemDataSourceDataPhysical,
|
||||
DS4ItemDataSourceDataProtective,
|
||||
} from "../item-data-source-base";
|
||||
|
||||
export interface DS4ArmorDataSource {
|
||||
type: "armor";
|
||||
data: DS4ArmorDataSourceData;
|
||||
}
|
||||
|
||||
export interface DS4ArmorDataSourceData
|
||||
extends DS4ItemDataSourceDataBase,
|
||||
DS4ItemDataSourceDataPhysical,
|
||||
DS4ItemDataSourceDataEquipable,
|
||||
DS4ItemDataSourceDataProtective {
|
||||
armorMaterialType: keyof typeof DS4.i18n.armorMaterialTypes;
|
||||
armorType: keyof typeof DS4.i18n.armorTypes;
|
||||
}
|
11
src/item/armor/armor.ts
Normal file
11
src/item/armor/armor.ts
Normal file
|
@ -0,0 +1,11 @@
|
|||
// SPDX-FileCopyrightText: 2022 Johannes Loher
|
||||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import { DS4Item } from "../item";
|
||||
|
||||
export class DS4Armor extends DS4Item {}
|
||||
|
||||
export interface DS4Armor {
|
||||
data: foundry.data.ItemData & { type: "armor"; _source: { type: "armor" } };
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue