Lint match_collector
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
function sameArrays(array1: Array<any>, array2: Array<any>) {
|
function sameArrays(array1: Array<number>, array2: Array<number>) {
|
||||||
if (array1.length != array2.length) return false
|
if (array1.length != array2.length) return false
|
||||||
for (const e of array1) {
|
for (const e of array1) {
|
||||||
if (!array2.includes(e)) return false
|
if (!array2.includes(e)) return false
|
||||||
@@ -71,7 +71,8 @@ type ChampionData = {
|
|||||||
lanes: Array<LaneData>
|
lanes: Array<LaneData>
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleParticipantRunes(participant, runes: Array<Rune>) {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
function handleParticipantRunes(participant: any, runes: Array<Rune>) {
|
||||||
const primaryStyle = participant.perks.styles[0].style
|
const primaryStyle = participant.perks.styles[0].style
|
||||||
const secondaryStyle = participant.perks.styles[1].style
|
const secondaryStyle = participant.perks.styles[1].style
|
||||||
const selections: Array<number> = []
|
const selections: Array<number> = []
|
||||||
@@ -101,7 +102,13 @@ function handleParticipantRunes(participant, runes: Array<Rune>) {
|
|||||||
if (addRunes) runes.push(gameRunes)
|
if (addRunes) runes.push(gameRunes)
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMatchItems(timeline, participant: any, participantIndex: number, builds: Builds) {
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
function handleMatchItems(
|
||||||
|
timeline: any,
|
||||||
|
participant: any,
|
||||||
|
participantIndex: number,
|
||||||
|
builds: Builds
|
||||||
|
) {
|
||||||
const items: Array<number> = []
|
const items: Array<number> = []
|
||||||
for (const frame of timeline.info.frames) {
|
for (const frame of timeline.info.frames) {
|
||||||
for (const event of frame.events) {
|
for (const event of frame.events) {
|
||||||
@@ -196,6 +203,7 @@ function handleMatchItems(timeline, participant: any, participantIndex: number,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
function handleMatch(match: any, champions: Map<number, ChampionData>) {
|
function handleMatch(match: any, champions: Map<number, ChampionData>) {
|
||||||
let participantIndex = 0
|
let participantIndex = 0
|
||||||
for (const participant of match.info.participants) {
|
for (const participant of match.info.participants) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
type ItemTree = {
|
type ItemTree = {
|
||||||
data: any
|
data: number | undefined
|
||||||
count: number
|
count: number
|
||||||
children: Array<ItemTree>
|
children: Array<ItemTree>
|
||||||
}
|
}
|
||||||
@@ -73,13 +73,6 @@ function treeCutBranches(itemtree: ItemTree, thresholdCount: number, thresholdPe
|
|||||||
itemtree.children.map(x => treeCutBranches(x, thresholdCount, thresholdPerc))
|
itemtree.children.map(x => treeCutBranches(x, thresholdCount, thresholdPerc))
|
||||||
}
|
}
|
||||||
|
|
||||||
function treeMergeTree(itemtree1: ItemTree, itemtree2: ItemTree) {
|
|
||||||
for (const child of itemtree2.children) {
|
|
||||||
const node = nodeMerge(itemtree1, child)
|
|
||||||
treeMergeTree(node, child)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function treeSort(itemtree: ItemTree) {
|
function treeSort(itemtree: ItemTree) {
|
||||||
itemtree.children.sort((a, b) => b.count - a.count)
|
itemtree.children.sort((a, b) => b.count - a.count)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user