-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,28 @@ | ||
import { parse as parse$ } from './pec2json'; | ||
import { parse as parseRPE$ } from './rpe2json'; | ||
import { readInfo as readInfo$ } from './readInfo'; | ||
import { normalizeLineEvents, normalizeSpeedEvents } from '../format'; | ||
namespace PEC { | ||
export const parse = parse$; | ||
export const parseRPE = parseRPE$; | ||
export function parse(pec: string, filename: string): ReturnType<typeof parse$> { | ||
const result = parse$(pec, filename); | ||
for (const line of result.data.judgeLineList) { | ||
normalizeSpeedEvents(line.speedEvents); | ||
normalizeLineEvents(line.judgeLineDisappearEvents); | ||
normalizeLineEvents(line.judgeLineMoveEvents); | ||
normalizeLineEvents(line.judgeLineRotateEvents); | ||
} | ||
return result; | ||
} | ||
export function parseRPE(pec: string, filename: string): ReturnType<typeof parseRPE$> { | ||
const result = parseRPE$(pec, filename); | ||
for (const line of result.data.judgeLineList) { | ||
normalizeSpeedEvents(line.speedEvents); | ||
normalizeLineEvents(line.judgeLineDisappearEvents); | ||
normalizeLineEvents(line.judgeLineMoveEvents); | ||
normalizeLineEvents(line.judgeLineRotateEvents); | ||
} | ||
return result; | ||
} | ||
export const readInfo = readInfo$; | ||
} | ||
export default PEC; |