Remove methods that don't need to be overridden for StringField

This commit is contained in:
Oliver-Akins 2024-04-19 18:51:56 -06:00
parent 5f1dc53a91
commit ee77f10957

View file

@ -4,7 +4,7 @@ import { statDice } from "../../config.mjs";
* A subclass of StringField that allows ActiveEffects to integrate with dice * A subclass of StringField that allows ActiveEffects to integrate with dice
* values and increase/decrease the value step-wise according to the dice ladder. * values and increase/decrease the value step-wise according to the dice ladder.
*/ */
export class DiceField extends foundry.data.fields.DataField { export class DiceField extends foundry.data.fields.StringField {
static get _defaults() { static get _defaults() {
return foundry.utils.mergeObject(super._defaults, { return foundry.utils.mergeObject(super._defaults, {
trim: true, trim: true,
@ -22,15 +22,6 @@ export class DiceField extends foundry.data.fields.DataField {
console.log(this.choices) console.log(this.choices)
}; };
applyChange(...args) {
console.log(`DiceField.applyChange`, args);
return super.applyChange(...args)
}
_cast(value) {
return String(value);
}
_castChangeDelta(delta) { _castChangeDelta(delta) {
console.log(`DiceField._castChangeDelta(${delta})`) console.log(`DiceField._castChangeDelta(${delta})`)
return parseInt(delta) ?? 0; return parseInt(delta) ?? 0;
@ -70,4 +61,9 @@ export class DiceField extends foundry.data.fields.DataField {
console.log(`.dungeon | Post: value=${value}; delta=${delta}`); console.log(`.dungeon | Post: value=${value}; delta=${delta}`);
return value return value
}; };
_applyChangeCustom(...args) {
console.log(`.dungeon | Dicefield._applyChangeCustom`)
return super._applyChangeCustom(...args);
}
}; };