MCPcopy Create free account
hub / github.com/Botloader/botloader / levelForXp

Function levelForXp

cmd/vmbench/scripts/medium/leveling.ts:11–22  ·  view source on GitHub ↗
(xp: number)

Source from the content-addressed store, hash-verified

9}
10
11function levelForXp(xp: number): number {
12 let level = 0;
13 let total = 0;
14 for (const threshold of levelThresholds) {
15 total += threshold;
16 if (xp < total) {
17 break;
18 }
19 level++;
20 }
21 return level;
22}
23
24function xpForNextLevel(xp: number): number {
25 let total = 0;

Callers 1

leveling.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected