Cleanup
- Partage méthode pour label des types - Methode joining pour concaténation - suppression template obsolete - Déplacement de singleton rencontre dans game.system.rdd - init des commandes lazy
This commit is contained in:
@ -24,7 +24,7 @@ export class Misc {
|
||||
}
|
||||
|
||||
static sum() {
|
||||
return (a, b) => a + b;
|
||||
return (a, b) => Number(a) + Number(b);
|
||||
}
|
||||
|
||||
static ascending(orderFunction = x => x) {
|
||||
@ -41,6 +41,10 @@ export class Misc {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static typeName(type, subType) {
|
||||
return game.i18n.localize(`${type.toUpperCase()}.Type${Misc.upperFirst(subType)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the value to an integer, or to 0 if undefined/null/not representing integer
|
||||
* @param {*} value value to convert to an integer using parseInt
|
||||
@ -102,7 +106,11 @@ export class Misc {
|
||||
}
|
||||
|
||||
static join(params, separator = '') {
|
||||
return params?.reduce((a, b) => a + separator + b) ?? '';
|
||||
return params?.reduce(Misc.joining(separator)) ?? '';
|
||||
}
|
||||
|
||||
static joining(separator = '') {
|
||||
return (a, b) => a + separator + b;
|
||||
}
|
||||
|
||||
static connectedGMOrUser(ownerId = undefined) {
|
||||
|
Reference in New Issue
Block a user