Recherche dans l'inventaire

Par nom ou par type, et dans les contenants
This commit is contained in:
2023-02-05 20:26:44 +01:00
parent 703ab2579d
commit fbcc167272
9 changed files with 86 additions and 50 deletions

View File

@ -304,6 +304,13 @@ export class RdDItem extends Item {
return this.parent?.type == 'commerce';
}
isNomLike(texte) {
return Grammar.includesLowerCaseNoAccent(this.name, texte)
}
isNomTypeLike(texte) {
return this.isNomLike(texte) || Grammar.includesLowerCaseNoAccent(Misc.typeName(this.type, 'Item'), texte)
}
getQuantite() {
return this.isService() ? undefined : Math.round(this.system.quantite ?? 0)
}