feat: skills are ordered by interest level, then by mastery level

This commit is contained in:
Adrien Marquès 2022-11-22 13:21:22 +01:00
parent d4e9d1449a
commit d493cf0f78
Signed by: xdrm-brackets
GPG Key ID: D75243CA236D825E
1 changed files with 3 additions and 5 deletions

View File

@ -18,11 +18,9 @@ export function available(): tID[] {
availCache.push(id);
}
availCache.sort( (a: tID, b: tID) => {
const aname = skillLabel(a);
const bname = skillLabel(b);
if ( aname < bname ) { return -1; }
if ( aname > bname ) { return 1; }
return 0;
const alevel = Skills[a].interest * 1.1 + Skills[a].mastery;
const blevel = Skills[b].interest * 1.1 + Skills[b].mastery;
return blevel - alevel;
});
return availCache;
}