Add JSdoc for the API
This commit is contained in:
parent
fd28993952
commit
96ef2ba56f
1 changed files with 7 additions and 0 deletions
|
|
@ -1,5 +1,12 @@
|
|||
import { gameTerms } from "../gameTerms.mjs";
|
||||
|
||||
/**
|
||||
* Converts a rank's name into an integer form for use in mathematical calculations
|
||||
* that rely on rank.
|
||||
*
|
||||
* @param {Novice|Adept|Expert|Master} rankName The rank to convert into an integer
|
||||
* @returns An integer between 1 and 4
|
||||
*/
|
||||
export function rankToInteger(rankName) {
|
||||
return Object.values(gameTerms.Rank)
|
||||
.findIndex(r => r === rankName) + 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue