feat(gvg): 组建期

This commit is contained in:
luying
2023-01-05 19:18:56 +08:00
parent 94c69089ac
commit 03fa74f3d1
50 changed files with 10354 additions and 38 deletions

View File

@@ -0,0 +1,42 @@
// 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;
}