clean getBestDraconic
* peut utiliser getDraconicList * list.sort pour trouver le meilleur * dupliquer seulement le meilleur
This commit is contained in:
parent
3c6a5e0c4d
commit
1fc3bf22f5
@ -91,20 +91,17 @@ export class RdDActor extends Actor {
|
||||
getCurrentReve() {
|
||||
return this.data.data.reve.reve.value;
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getBestDraconic() {
|
||||
|
||||
let draconic = {name: "none", niveau: -11 };
|
||||
for (const item of this.data.items) {
|
||||
//console.log(item);
|
||||
if ( item.data.categorie && item.data.categorie.toLowerCase() == "draconic") {
|
||||
if (item.data.niveau > draconic.niveau) draconic = duplicate(item);
|
||||
}
|
||||
const list = this.getDraconicList().sort((a, b) => b.data.niveau - a.data.niveau);
|
||||
if (list.length==0)
|
||||
{
|
||||
return { name: "none", niveau: -11 };
|
||||
}
|
||||
return draconic;
|
||||
return duplicate(list[0]);
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async deleteSortReserve(coordTMR) {
|
||||
let reserve = duplicate(this.data.data.reve.reserve);
|
||||
|
Loading…
Reference in New Issue
Block a user