filter shenanigans

This commit is contained in:
2024-07-15 18:14:02 +02:00
parent be9cffef4f
commit 3aec40658f
5 changed files with 277 additions and 10 deletions
+28
View File
@@ -0,0 +1,28 @@
import {Job, jobFromString} from "@/enums/Job";
export default class Filters {
minLevel: number;
maxLevel: number;
jobs: Job[] = [];
constructor(
data?: {
minLevel?: number,
maxLevel?: number,
jobs?: string[],
},
) {
this.minLevel = data?.minLevel || 1;
this.maxLevel = data?.maxLevel || 100;
const jobData = data?.jobs || [];
for (const job of jobData) {
const parsedJob = jobFromString(job);
if (!parsedJob) continue;
this.jobs.push(parsedJob);
}
}
}