Files
ZYZ/shared/pubUtils/dictionary/DicGVGPeriod.ts
2023-02-17 10:58:03 +08:00

43 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// GVG周期表
import { FILENAME } from '../../consts'
import { parseNumberList, readFileAndParse } from '../util'
export interface DicGVGPeriod {
// 1-组建期 2-备战期 3-激战期
readonly periodType: number;
// 星期几 1-7
readonly day: number[];
// 星期几 1-7
readonly startDay: number;
// HH:mm, 组建期备战期填05:00。激战期填20:40
readonly startHour: number;
readonly startMinute: number;
readonly startSecond: number;
// HH:mm组建期填截止创建联军时间备战期填22:00激战期填21:40
readonly endHour: number;
readonly endMinute: number;
readonly endSecond: number;
}
export const dicGVGPeriod = new Map<number, DicGVGPeriod>();
export function loadGVGPeriod() {
dicGVGPeriod.clear();
let arr = readFileAndParse(FILENAME.DIC_GVG_PERIOD);
arr.forEach(o => {
o.day = parseNumberList(o.day);
o.startDay = o.day[0];
let startTime = o.startTime.split(':');
o.startHour = parseInt(startTime[0]);
o.startMinute = parseInt(startTime[1]);
o.startSecond = parseInt(startTime[2]);
let endTime = o.endTime.split(':');
o.endHour = parseInt(endTime[0]);
o.endMinute = parseInt(endTime[1]);
o.endSecond = parseInt(endTime[2]);
dicGVGPeriod.set(o.periodType, o);
});
arr = undefined;
}