Correction du parser des bonus de case
This commit is contained in:
parent
538cf5bdbf
commit
43607afc12
@ -65,9 +65,9 @@ export class RdDItemSort extends Item {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static buildBonusCaseList(bonuscase, newCase) {
|
static buildBonusCaseList(bonuscase, newCase) {
|
||||||
const list = RdDItemSort._bonuscaseStringToList(bonuscase)
|
const list = RdDItemSort.bonuscaseStringToList(bonuscase)
|
||||||
if (newCase) {
|
if (newCase) {
|
||||||
return list.concat({ case: "Nouvelle", bonus: 0 });
|
list.push({ case: "Nouvelle", bonus: 0 })
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@ -138,8 +138,11 @@ export class RdDItemSort extends Item {
|
|||||||
.sort(Misc.ascending())
|
.sort(Misc.ascending())
|
||||||
.join(',');
|
.join(',');
|
||||||
}
|
}
|
||||||
static _bonuscaseStringToList(bonuscase) {
|
static bonuscaseStringToList(bonuscase) {
|
||||||
return (bonuscase ?? '').split(',').map(it => {
|
if (bonuscase == undefined || bonuscase == '') {
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
return bonuscase.split(',').map(it => {
|
||||||
const b = it.split(':');
|
const b = it.split(':');
|
||||||
return { case: b[0], bonus: b[1] };
|
return { case: b[0], bonus: b[1] };
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user