mirror of
https://github.com/YouHaveTrouble/DiscipleOfLand.git
synced 2026-05-12 06:26:56 +00:00
29 lines
635 B
TypeScript
29 lines
635 B
TypeScript
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 || 91;
|
|
this.maxLevel = data?.maxLevel || 100;
|
|
const jobData = data?.jobs || [Job.BOTANIST, Job.MINER];
|
|
|
|
for (const job of jobData) {
|
|
const parsedJob = jobFromString(job);
|
|
if (!parsedJob) continue;
|
|
this.jobs.push(parsedJob);
|
|
}
|
|
|
|
}
|
|
|
|
}
|