some factorisation

This commit is contained in:
Vlyan
2020-12-16 19:05:18 +01:00
parent d9d9f43423
commit 182219337d
30 changed files with 269 additions and 393 deletions

View File

@@ -14,35 +14,4 @@ export class AdvancementSheetL5r5e extends ItemSheetL5r5e {
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
});
}
getData() {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isAdvancement = true;
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) {
return;
}
}
/**
* Update item with values from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}

View File

@@ -14,34 +14,4 @@ export class ArmorSheetL5r5e extends ItemSheetL5r5e {
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
});
}
getData() {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isArmor = true;
sheetData.data.isEquipment = true;
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
}
/**
* Update item with values from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}

View File

@@ -19,8 +19,6 @@ export class ItemSheetL5r5e extends ItemSheet {
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isEquipment = true;
return sheetData;
}
@@ -32,7 +30,9 @@ export class ItemSheetL5r5e extends ItemSheet {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
// if (!this.options.editable) {
// return;
// }
}
/**

View File

@@ -14,35 +14,4 @@ export class QualitySheetL5r5e extends ItemSheetL5r5e {
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
});
}
getData() {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isQuality = true;
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) {
return;
}
}
/**
* Update item with values from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}

View File

@@ -14,36 +14,4 @@ export class TechniqueSheetL5r5e extends ItemSheetL5r5e {
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }],
});
}
/** @override */
getData() {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isTechnique = true;
// sheetData.data.isEquipment = false;
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
}
/**
* Update feat with the data from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
// Update the Item
return this.object.update(formData);
}
}

View File

@@ -20,32 +20,11 @@ export class WeaponSheetL5r5e extends ItemSheetL5r5e {
const sheetData = super.getData();
sheetData.data.dtypes = ["String", "Number", "Boolean"];
sheetData.data.isWeapon = true;
sheetData.data.isEquipment = true;
// Martial skills only
sheetData.data.skills = Array.from(L5R5E.skills)
.filter(([id, cat]) => cat === "martial")
.map(([id, cat]) => id);
return sheetData;
}
/**
* Subscribe to events from the sheet.
* @param html HTML content of the sheet.
*/
activateListeners(html) {
super.activateListeners(html);
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) return;
}
/**
* Update item with values from the sheet.
* @param event
* @param formData
*/
_updateObject(event, formData) {
return this.object.update(formData);
}
}