mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-05 05:18:12 +03:00
More big updates (just incase hdd dies or something)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
ChartDocument,
|
||||
Game,
|
||||
IDStrings,
|
||||
integer,
|
||||
SessionScoreInfo,
|
||||
SongDocument,
|
||||
} from "tachi-common";
|
||||
|
||||
export function GetPBs(scoreInfo: SessionScoreInfo[]) {
|
||||
return scoreInfo.map(e => e.isNewScore === true || e.lampDelta > 0 || e.scoreDelta > 0);
|
||||
}
|
||||
|
||||
export function CreateSongMap<G extends Game = Game>(songs: SongDocument<G>[]) {
|
||||
const songMap = new Map<integer, SongDocument<G>>();
|
||||
|
||||
for (const song of songs) {
|
||||
songMap.set(song.id, song);
|
||||
}
|
||||
|
||||
return songMap;
|
||||
}
|
||||
|
||||
export function CreateChartMap<I extends IDStrings = IDStrings>(charts: ChartDocument<I>[]) {
|
||||
const chartMap = new Map<string, ChartDocument<I>>();
|
||||
|
||||
for (const chart of charts) {
|
||||
chartMap.set(chart.chartID, chart);
|
||||
}
|
||||
|
||||
return chartMap;
|
||||
}
|
||||
Reference in New Issue
Block a user