Utilisation nullish / chaining
Simplifie certaines expressions complexes avec operateur ternaire - Nullish coalescing operator (??) - Relationship with the optional chaining operator (?.) - Math.min / Math.max / Math.ceil
This commit is contained in:
@ -122,7 +122,7 @@ export class RdDResolutionTable {
|
||||
list.push({ label: surprise.descr, value: surprise.attaque });
|
||||
}
|
||||
if (rollData.diffLibre != undefined) {
|
||||
const label = rollData.selectedSort ? rollData.selectedSort.name : 'Libre';
|
||||
const label = rollData.selectedSort?.name ?? 'Libre';
|
||||
list.push({ label: label, value: rollData.diffLibre });
|
||||
}
|
||||
if (rollData.diffConditions != undefined) {
|
||||
@ -131,11 +131,11 @@ export class RdDResolutionTable {
|
||||
if (rollData.etat != undefined) {
|
||||
list.push({ label: 'Etat', value: rollData.etat });
|
||||
}
|
||||
if (rollData.selectedCarac != undefined && rollData.moral != undefined && rollData.selectedCarac.label == 'Volonté') {
|
||||
list.push({ label: 'Moral', value: rollData.selectedCarac != undefined && rollData.moral != undefined && rollData.selectedCarac.label == 'Volonté' ? rollData.moral : undefined });
|
||||
if (rollData.selectedCarac?.label == 'Volonté' && rollData.moral != undefined) {
|
||||
list.push({ label: 'Moral', value: rollData.moral });
|
||||
}
|
||||
if (RdDResolutionTable.isAjustementAstrologique(rollData)) {
|
||||
list.push({ label: 'Astrologique', value: rollData.ajustementAstrologique || 0 });
|
||||
list.push({ label: 'Astrologique', value: rollData.ajustementAstrologique ?? 0 });
|
||||
}
|
||||
if (rollData.rolled.bonus && rollData.selectedSort) {
|
||||
list.push({ descr: `Bonus de case: ${rollData.rolled.bonus}%` });
|
||||
|
Reference in New Issue
Block a user