Cut boots below percentage
This commit is contained in:
@@ -15,6 +15,18 @@ async function itemList() {
|
||||
return list
|
||||
}
|
||||
|
||||
function arrayRemovePercentage(array: Array<{count:number}>, totalGames:number, percentage: number) {
|
||||
let toRemove : Array<{count:number}> = []
|
||||
for(let item of array) {
|
||||
if((item.count/totalGames) < 0.05) {
|
||||
toRemove.push(item)
|
||||
}
|
||||
}
|
||||
for(let tr of toRemove) {
|
||||
array.splice(array.indexOf(tr), 1)
|
||||
}
|
||||
}
|
||||
|
||||
type Rune = {
|
||||
count: number
|
||||
primaryStyle: number
|
||||
@@ -175,16 +187,12 @@ async function championInfos(client, patch: number, champion: Champion) {
|
||||
let leastUsedItem = builds.start.reduce((a, b) => Math.min(a.count, b.count) == a.count ? a : b, {data:undefined, count: +Infinity})
|
||||
builds.start.splice(builds.start.indexOf(leastUsedItem), 1)
|
||||
}
|
||||
let toRemove : Array<{data: number, count:number}> = []
|
||||
for(let item of builds.start) {
|
||||
if((item.count/(winningMatches + losingMatches)) < 0.05) {
|
||||
toRemove.push(item)
|
||||
}
|
||||
}
|
||||
for(let tr of toRemove) {
|
||||
builds.start.splice(builds.start.indexOf(tr), 1)
|
||||
}
|
||||
arrayRemovePercentage(builds.start, (winningMatches + losingMatches), 0.05)
|
||||
builds.start.sort((a, b) => b.count - a.count)
|
||||
|
||||
// Remove boots that are not within percentage threshold
|
||||
arrayRemovePercentage(builds.boots, (winningMatches + losingMatches), 0.05)
|
||||
|
||||
builds.boots.sort((a, b) => b.count - a.count)
|
||||
builds.bootsFirst /= (winningMatches + losingMatches)
|
||||
builds.lateGame.sort((a, b) => b.count - a.count)
|
||||
|
||||
Reference in New Issue
Block a user