Added mw modes table
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { CLASSES, DIFFICULTIES } from "@/data/hypixel/megawalls"
|
||||
import { CLASSES, DIFFICULTIES, MODES } from "@/data/hypixel/megawalls"
|
||||
import { NonNullStats } from "@/lib/schema/player"
|
||||
import { devide } from "../general"
|
||||
|
||||
export function getMostPlayed(stats: NonNullable<NonNullStats["MegaWalls"]>) {
|
||||
let mostPlayedClass: typeof CLASSES[number] | null = null
|
||||
@@ -22,3 +23,18 @@ export function getMostPlayed(stats: NonNullable<NonNullStats["MegaWalls"]>) {
|
||||
export function getDifficultyColor(val: 1 | 2 | 3 | 4) {
|
||||
return DIFFICULTIES[val]
|
||||
}
|
||||
|
||||
export function getMegaWallsModeName(modeId: typeof MODES[number]["id"]) {
|
||||
return MODES.find(m => m.id === modeId)!.name
|
||||
}
|
||||
|
||||
export function getMegaWallsModeStats(modeId: typeof MODES[number]["id"], stats: NonNullable<NonNullStats["MegaWalls"]>) {
|
||||
return [
|
||||
stats[`kills_${modeId}`],
|
||||
stats[`deaths_${modeId}`],
|
||||
devide(stats[`kills_${modeId}`], stats[`deaths_${modeId}`]),
|
||||
stats[`wins_${modeId}`],
|
||||
stats[`losses_${modeId}`],
|
||||
devide(stats[`wins_${modeId}`], stats[`losses_${modeId}`])
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user