More shit

Feels like I'm skill issue
This commit is contained in:
dan63047 2023-08-08 22:30:24 +03:00
parent 518f2db7ea
commit e2c5a652d1
3 changed files with 804 additions and 15 deletions

View File

@ -893,7 +893,7 @@ class TetrioPlayersLeaderboard {
TetrioPlayersLeaderboard(this.type, this.leaderboard); TetrioPlayersLeaderboard(this.type, this.leaderboard);
List<dynamic> getAverageOfRank(String rank){ List<dynamic> getAverageOfRank(String rank){ // TODO: that function is a mess, there must be a better way to do this
if (rank.isNotEmpty && !rankCutoffs.keys.contains(rank)) throw Exception("Invalid rank"); if (rank.isNotEmpty && !rankCutoffs.keys.contains(rank)) throw Exception("Invalid rank");
List<TetrioPlayerFromLeaderboard> filtredLeaderboard = List.from(leaderboard); List<TetrioPlayerFromLeaderboard> filtredLeaderboard = List.from(leaderboard);
if (rank.isNotEmpty) { if (rank.isNotEmpty) {
@ -908,18 +908,65 @@ class TetrioPlayersLeaderboard {
avgTR = 0, avgTR = 0,
avgGlicko = 0, avgGlicko = 0,
avgRD = 0, avgRD = 0,
avgAPP = 0,
avgVSAPM = 0,
avgDSS = 0,
avgDSP = 0,
avgAPPDSP = 0,
avgCheese = 0,
avgGBE = 0,
avgNyaAPP = 0,
avgArea = 0,
avgEstTR = 0,
avgEstAcc = 0,
avgOpener = 0,
avgPlonk = 0,
avgStride = 0,
avgInfDS = 0,
lowestTR = 25000, lowestTR = 25000,
lowestGlicko = double.infinity, lowestGlicko = double.infinity,
lowestRD = double.infinity,
lowestWinrate = double.infinity, lowestWinrate = double.infinity,
lowestAPM = double.infinity, lowestAPM = double.infinity,
lowestPPS = double.infinity, lowestPPS = double.infinity,
lowestVS = double.infinity, lowestVS = double.infinity,
highestTR = 0, lowestAPP = double.infinity,
highestGlicko = 0, lowestVSAPM = double.infinity,
highestWinrate = 0, lowestDSS = double.infinity,
highestAPM = 0, lowestDSP = double.infinity,
highestPPS = 0, lowestAPPDSP = double.infinity,
highestVS = 0; lowestCheese = double.infinity,
lowestGBE = double.infinity,
lowestNyaAPP = double.infinity,
lowestArea = double.infinity,
lowestEstTR = double.infinity,
lowestEstAcc = double.infinity,
lowestOpener = double.infinity,
lowestPlonk = double.infinity,
lowestStride = double.infinity,
lowestInfDS = double.infinity,
highestTR = double.negativeInfinity,
highestGlicko = double.negativeInfinity,
highestRD = double.negativeInfinity,
highestWinrate = double.negativeInfinity,
highestAPM = double.negativeInfinity,
highestPPS = double.negativeInfinity,
highestVS = double.negativeInfinity,
highestAPP = double.negativeInfinity,
highestVSAPM = double.negativeInfinity,
highestDSS = double.negativeInfinity,
highestDSP = double.negativeInfinity,
highestAPPDSP = double.negativeInfinity,
highestCheese = double.negativeInfinity,
highestGBE = double.negativeInfinity,
highestNyaAPP = double.negativeInfinity,
highestArea = double.negativeInfinity,
highestEstTR = double.negativeInfinity,
highestEstAcc = double.negativeInfinity,
highestOpener = double.negativeInfinity,
highestPlonk = double.negativeInfinity,
highestStride = double.negativeInfinity,
highestInfDS = double.negativeInfinity;
int avgGamesPlayed = 0, int avgGamesPlayed = 0,
avgGamesWon = 0, avgGamesWon = 0,
totalGamesPlayed = 0, totalGamesPlayed = 0,
@ -930,20 +977,52 @@ class TetrioPlayersLeaderboard {
highestGamesWon = 0; highestGamesWon = 0;
String lowestTRid = "", lowestTRnick = "", String lowestTRid = "", lowestTRnick = "",
lowestGlickoID = "", lowestGlickoNick = "", lowestGlickoID = "", lowestGlickoNick = "",
lowestRdID = "", lowestRdNick = "",
lowestGamesPlayedID = "", lowestGamesPlayedNick = "", lowestGamesPlayedID = "", lowestGamesPlayedNick = "",
lowestGamesWonID = "", lowestGamesWonNick = "", lowestGamesWonID = "", lowestGamesWonNick = "",
lowestWinrateID = "", lowestWinrateNick = "", lowestWinrateID = "", lowestWinrateNick = "",
lowestAPMid = "", lowestAPMnick = "", lowestAPMid = "", lowestAPMnick = "",
lowestPPSid = "", lowestPPSnick = "", lowestPPSid = "", lowestPPSnick = "",
lowestVSid = "", lowestVSnick = "", lowestVSid = "", lowestVSnick = "",
lowestAPPid = "", lowestAPPnick = "",
lowestVSAPMid = "", lowestVSAPMnick = "",
lowestDSSid = "", lowestDSSnick = "",
lowestDSPid = "", lowestDSPnick = "",
lowestAPPDSPid = "", lowestAPPDSPnick = "",
lowestCheeseID = "", lowestCheeseNick = "",
lowestGBEid = "", lowestGBEnick = "",
lowestNyaAPPid = "", lowestNyaAPPnick = "",
lowestAreaID = "", lowestAreaNick = "",
lowestEstTRid = "", lowestEstTRnick = "",
lowestEstAccID = "", lowestEstAccNick = "",
lowestOpenerID = "", lowestOpenerNick = "",
lowestPlonkID = "", lowestPlonkNick = "",
lowestStrideID = "", lowestStrideNick = "",
lowestInfDSid = "", lowestInfDSnick = "",
highestTRid = "", highestTRnick = "", highestTRid = "", highestTRnick = "",
highestGlickoID = "", highestGlickoNick = "", highestGlickoID = "", highestGlickoNick = "",
highestRdID = "", highestRdNick = "",
highestGamesPlayedID = "", highestGamesPlayedNick = "", highestGamesPlayedID = "", highestGamesPlayedNick = "",
highestGamesWonID = "", highestGamesWonNick = "", highestGamesWonID = "", highestGamesWonNick = "",
highestWinrateID = "", highestWinrateNick = "", highestWinrateID = "", highestWinrateNick = "",
highestAPMid = "", highestAPMnick = "", highestAPMid = "", highestAPMnick = "",
highestPPSid = "", highestPPSnick = "", highestPPSid = "", highestPPSnick = "",
highestVSid = "", highestVSnick = ""; highestVSid = "", highestVSnick = "",
highestAPPid = "", highestAPPnick = "",
highestVSAPMid = "", highestVSAPMnick = "",
highestDSSid = "", highestDSSnick = "",
highestDSPid = "", highestDSPnick = "",
highestAPPDSPid = "", highestAPPDSPnick = "",
highestCheeseID = "", highestCheeseNick = "",
highestGBEid = "", highestGBEnick = "",
highestNyaAPPid = "", highestNyaAPPnick = "",
highestAreaID = "", highestAreaNick = "",
highestEstTRid = "", highestEstTRnick = "",
highestEstAccID = "", highestEstAccNick = "",
highestOpenerID = "", highestOpenerNick = "",
highestPlonkID = "", highestPlonkNick = "",
highestStrideID = "", highestStrideNick = "",
highestInfDSid = "", highestInfDSnick = "";
for (var entry in filtredLeaderboard){ for (var entry in filtredLeaderboard){
avgAPM += entry.apm; avgAPM += entry.apm;
avgPPS += entry.pps; avgPPS += entry.pps;
@ -951,6 +1030,21 @@ class TetrioPlayersLeaderboard {
avgTR += entry.rating; avgTR += entry.rating;
avgGlicko += entry.glicko; avgGlicko += entry.glicko;
avgRD += entry.rd; avgRD += entry.rd;
avgAPP += entry.nerdStats.app;
avgVSAPM += entry.nerdStats.vsapm;
avgDSS += entry.nerdStats.dss;
avgDSP += entry.nerdStats.dsp;
avgAPPDSP += entry.nerdStats.appdsp;
avgCheese += entry.nerdStats.cheese;
avgGBE += entry.nerdStats.gbe;
avgNyaAPP += entry.nerdStats.nyaapp;
avgArea += entry.nerdStats.area;
avgEstTR += entry.estTr.esttr;
avgEstAcc += entry.esttracc;
avgOpener += entry.playstyle.opener;
avgPlonk += entry.playstyle.plonk;
avgStride += entry.playstyle.stride;
avgInfDS += entry.playstyle.infds;
totalGamesPlayed += entry.gamesPlayed; totalGamesPlayed += entry.gamesPlayed;
totalGamesWon += entry.gamesWon; totalGamesWon += entry.gamesWon;
if (entry.rating < lowestTR){ if (entry.rating < lowestTR){
@ -963,6 +1057,11 @@ class TetrioPlayersLeaderboard {
lowestGlickoID = entry.userId; lowestGlickoID = entry.userId;
lowestGlickoNick = entry.username; lowestGlickoNick = entry.username;
} }
if (entry.rd < lowestRD){
lowestRD = entry.rd;
lowestRdID = entry.userId;
lowestRdNick = entry.username;
}
if (entry.gamesPlayed < lowestGamesPlayed){ if (entry.gamesPlayed < lowestGamesPlayed){
lowestGamesPlayed = entry.gamesPlayed; lowestGamesPlayed = entry.gamesPlayed;
lowestGamesPlayedID = entry.userId; lowestGamesPlayedID = entry.userId;
@ -993,6 +1092,81 @@ class TetrioPlayersLeaderboard {
lowestVSid = entry.userId; lowestVSid = entry.userId;
lowestVSnick = entry.username; lowestVSnick = entry.username;
} }
if (entry.nerdStats.app < lowestAPP){
lowestAPP = entry.nerdStats.app;
lowestAPPid = entry.userId;
lowestAPPnick = entry.username;
}
if (entry.nerdStats.vsapm < lowestVSAPM){
lowestVSAPM = entry.nerdStats.vsapm;
lowestVSAPMid = entry.userId;
lowestVSAPMnick = entry.username;
}
if (entry.nerdStats.dss < lowestDSS){
lowestDSS = entry.nerdStats.dss;
lowestDSSid = entry.userId;
lowestDSSnick = entry.username;
}
if (entry.nerdStats.dsp < lowestDSP){
lowestDSP = entry.nerdStats.dsp;
lowestDSPid = entry.userId;
lowestDSPnick = entry.username;
}
if (entry.nerdStats.appdsp < lowestAPPDSP){
lowestAPPDSP = entry.nerdStats.appdsp;
lowestAPPDSPid = entry.userId;
lowestAPPDSPnick = entry.username;
}
if (entry.nerdStats.cheese < lowestCheese){
lowestCheese = entry.nerdStats.cheese;
lowestCheeseID = entry.userId;
lowestCheeseNick = entry.username;
}
if (entry.nerdStats.gbe < lowestGBE){
lowestGBE = entry.nerdStats.gbe;
lowestGBEid = entry.userId;
lowestGBEnick = entry.username;
}
if (entry.nerdStats.nyaapp < lowestNyaAPP){
lowestNyaAPP = entry.nerdStats.nyaapp;
lowestNyaAPPid = entry.userId;
lowestNyaAPPnick = entry.username;
}
if (entry.nerdStats.area < lowestArea){
lowestArea = entry.nerdStats.area;
lowestAreaID = entry.userId;
lowestAreaNick = entry.username;
}
if (entry.estTr.esttr < lowestEstTR){
lowestEstTR = entry.estTr.esttr;
lowestEstTRid = entry.userId;
lowestEstTRnick = entry.username;
}
if (entry.esttracc < lowestEstAcc){
lowestEstAcc = entry.esttracc;
lowestEstAccID = entry.userId;
lowestEstAccNick = entry.username;
}
if (entry.playstyle.opener < lowestOpener){
lowestOpener = entry.playstyle.opener;
lowestOpenerID = entry.userId;
lowestOpenerNick = entry.username;
}
if (entry.playstyle.plonk < lowestPlonk){
lowestPlonk = entry.playstyle.plonk;
lowestPlonkID = entry.userId;
lowestPlonkNick = entry.username;
}
if (entry.playstyle.stride < lowestStride){
lowestStride = entry.playstyle.stride;
lowestStrideID = entry.userId;
lowestStrideNick = entry.username;
}
if (entry.playstyle.infds < lowestInfDS){
lowestInfDS = entry.playstyle.infds;
lowestInfDSid = entry.userId;
lowestInfDSnick = entry.username;
}
if (entry.rating > highestTR){ if (entry.rating > highestTR){
highestTR = entry.rating; highestTR = entry.rating;
highestTRid = entry.userId; highestTRid = entry.userId;
@ -1003,6 +1177,11 @@ class TetrioPlayersLeaderboard {
highestGlickoID = entry.userId; highestGlickoID = entry.userId;
highestGlickoNick = entry.username; highestGlickoNick = entry.username;
} }
if (entry.rd > highestRD){
highestRD = entry.rd;
highestRdID = entry.userId;
highestRdNick = entry.username;
}
if (entry.gamesPlayed > highestGamesPlayed){ if (entry.gamesPlayed > highestGamesPlayed){
highestGamesPlayed = entry.gamesPlayed; highestGamesPlayed = entry.gamesPlayed;
highestGamesPlayedID = entry.userId; highestGamesPlayedID = entry.userId;
@ -1033,6 +1212,81 @@ class TetrioPlayersLeaderboard {
highestVSid = entry.userId; highestVSid = entry.userId;
highestVSnick = entry.username; highestVSnick = entry.username;
} }
if (entry.nerdStats.app > highestAPP){
highestAPP = entry.nerdStats.app;
highestAPPid = entry.userId;
highestAPPnick = entry.username;
}
if (entry.nerdStats.vsapm > highestVSAPM){
highestVSAPM = entry.nerdStats.vsapm;
highestVSAPMid = entry.userId;
highestVSAPMnick = entry.username;
}
if (entry.nerdStats.dss > highestDSS){
highestDSS = entry.nerdStats.dss;
highestDSSid = entry.userId;
highestDSSnick = entry.username;
}
if (entry.nerdStats.dsp > highestDSP){
highestDSP = entry.nerdStats.dsp;
highestDSPid = entry.userId;
highestDSPnick = entry.username;
}
if (entry.nerdStats.appdsp > highestAPPDSP){
highestAPPDSP = entry.nerdStats.appdsp;
highestAPPDSPid = entry.userId;
highestAPPDSPnick = entry.username;
}
if (entry.nerdStats.cheese > highestCheese){
highestCheese = entry.nerdStats.cheese;
highestCheeseID = entry.userId;
highestCheeseNick = entry.username;
}
if (entry.nerdStats.gbe > highestGBE){
highestGBE = entry.nerdStats.gbe;
highestGBEid = entry.userId;
highestGBEnick = entry.username;
}
if (entry.nerdStats.nyaapp > highestNyaAPP){
highestNyaAPP = entry.nerdStats.nyaapp;
highestNyaAPPid = entry.userId;
highestNyaAPPnick = entry.username;
}
if (entry.nerdStats.area > highestArea){
highestArea = entry.nerdStats.area;
highestAreaID = entry.userId;
highestAreaNick = entry.username;
}
if (entry.estTr.esttr > highestEstTR){
highestEstTR = entry.estTr.esttr;
highestEstTRid = entry.userId;
highestEstTRnick = entry.username;
}
if (entry.esttracc > highestEstAcc){
highestEstAcc = entry.esttracc;
highestEstAccID = entry.userId;
highestEstAccNick = entry.username;
}
if (entry.playstyle.opener > highestOpener){
highestOpener = entry.playstyle.opener;
highestOpenerID = entry.userId;
highestOpenerNick = entry.username;
}
if (entry.playstyle.plonk > highestPlonk){
highestPlonk = entry.playstyle.plonk;
highestPlonkID = entry.userId;
highestPlonkNick = entry.username;
}
if (entry.playstyle.stride > highestStride){
highestStride = entry.playstyle.stride;
highestStrideID = entry.userId;
highestStrideNick = entry.username;
}
if (entry.playstyle.infds > highestInfDS){
highestInfDS = entry.playstyle.infds;
highestInfDSid = entry.userId;
highestInfDSnick = entry.username;
}
} }
avgAPM /= filtredLeaderboard.length; avgAPM /= filtredLeaderboard.length;
avgPPS /= filtredLeaderboard.length; avgPPS /= filtredLeaderboard.length;
@ -1040,6 +1294,21 @@ class TetrioPlayersLeaderboard {
avgTR /= filtredLeaderboard.length; avgTR /= filtredLeaderboard.length;
avgGlicko /= filtredLeaderboard.length; avgGlicko /= filtredLeaderboard.length;
avgRD /= filtredLeaderboard.length; avgRD /= filtredLeaderboard.length;
avgAPP /= filtredLeaderboard.length;
avgVSAPM /= filtredLeaderboard.length;
avgDSS /= filtredLeaderboard.length;
avgDSP /= filtredLeaderboard.length;
avgAPPDSP /= leaderboard.length;
avgCheese /= filtredLeaderboard.length;
avgGBE /= filtredLeaderboard.length;
avgNyaAPP /= filtredLeaderboard.length;
avgArea /= filtredLeaderboard.length;
avgEstTR /= filtredLeaderboard.length;
avgEstAcc /= filtredLeaderboard.length;
avgOpener /= filtredLeaderboard.length;
avgPlonk /= filtredLeaderboard.length;
avgStride /= filtredLeaderboard.length;
avgInfDS /= filtredLeaderboard.length;
avgGamesPlayed = (totalGamesPlayed / filtredLeaderboard.length).floor(); avgGamesPlayed = (totalGamesPlayed / filtredLeaderboard.length).floor();
avgGamesWon = (totalGamesWon / filtredLeaderboard.length).floor(); avgGamesWon = (totalGamesWon / filtredLeaderboard.length).floor();
return [TetraLeagueAlpha(timestamp: DateTime.now(), apm: avgAPM, pps: avgPPS, vs: avgVS, glicko: avgGlicko, rd: avgRD, gamesPlayed: avgGamesPlayed, gamesWon: avgGamesWon, bestRank: rank, decaying: false, rating: avgTR, rank: rank, percentileRank: rank, percentile: rankCutoffs[rank]!, standing: -1, standingLocal: -1, nextAt: -1, prevAt: -1), return [TetraLeagueAlpha(timestamp: DateTime.now(), apm: avgAPM, pps: avgPPS, vs: avgVS, glicko: avgGlicko, rd: avgRD, gamesPlayed: avgGamesPlayed, gamesWon: avgGamesWon, bestRank: rank, decaying: false, rating: avgTR, rank: rank, percentileRank: rank, percentile: rankCutoffs[rank]!, standing: -1, standingLocal: -1, nextAt: -1, prevAt: -1),
@ -1053,6 +1322,9 @@ class TetrioPlayersLeaderboard {
"lowestGlicko": lowestGlicko, "lowestGlicko": lowestGlicko,
"lowestGlickoID": lowestGlickoID, "lowestGlickoID": lowestGlickoID,
"lowestGlickoNick": lowestGlickoNick, "lowestGlickoNick": lowestGlickoNick,
"lowestRD": lowestRD,
"lowestRdID": lowestRdID,
"lowestRdNick": lowestRdNick,
"lowestGamesPlayed": lowestGamesPlayed, "lowestGamesPlayed": lowestGamesPlayed,
"lowestGamesPlayedID": lowestGamesPlayedID, "lowestGamesPlayedID": lowestGamesPlayedID,
"lowestGamesPlayedNick": lowestGamesPlayedNick, "lowestGamesPlayedNick": lowestGamesPlayedNick,
@ -1071,12 +1343,60 @@ class TetrioPlayersLeaderboard {
"lowestVS": lowestVS, "lowestVS": lowestVS,
"lowestVSid": lowestVSid, "lowestVSid": lowestVSid,
"lowestVSnick": lowestVSnick, "lowestVSnick": lowestVSnick,
"lowestAPP": lowestAPP,
"lowestAPPid": lowestAPPid,
"lowestAPPnick": lowestAPPnick,
"lowestVSAPM": lowestVSAPM,
"lowestVSAPMid": lowestVSAPMid,
"lowestVSAPMnick": lowestVSAPMnick,
"lowestDSS": lowestDSS,
"lowestDSSid": lowestDSSid,
"lowestDSSnick": lowestDSSnick,
"lowestDSP": lowestDSP,
"lowestDSPid": lowestDSPid,
"lowestDSPnick": lowestDSPnick,
"lowestAPPDSP": lowestAPPDSP,
"lowestAPPDSPid": lowestAPPDSPid,
"lowestAPPDSPnick": lowestAPPDSPnick,
"lowestCheese": lowestCheese,
"lowestCheeseID": lowestCheeseID,
"lowestCheeseNick": lowestCheeseNick,
"lowestGBE": lowestGBE,
"lowestGBEid": lowestGBEid,
"lowestGBEnick": lowestGBEnick,
"lowestNyaAPP": lowestNyaAPP,
"lowestNyaAPPid": lowestNyaAPPid,
"lowestNyaAPPnick": lowestNyaAPPnick,
"lowestArea": lowestArea,
"lowestAreaID": lowestAreaID,
"lowestAreaNick": lowestAreaNick,
"lowestEstTR": lowestEstTR,
"lowestEstTRid": lowestEstTRid,
"lowestEstTRnick": lowestEstTRnick,
"lowestEstAcc": lowestEstAcc,
"lowestEstAccID": lowestEstAccID,
"lowestEstAccNick": lowestEstAccNick,
"lowestOpener": lowestOpener,
"lowestOpenerID": lowestOpenerID,
"lowestOpenerNick": lowestOpenerNick,
"lowestPlonk": lowestPlonk,
"lowestPlonkID": lowestPlonkID,
"lowestPlonkNick": lowestPlonkNick,
"lowestStride": lowestStride,
"lowestStrideID": lowestStrideID,
"lowestStrideNick": lowestStrideNick,
"lowestInfDS": lowestInfDS,
"lowestInfDSid": lowestInfDSid,
"lowestInfDSnick": lowestInfDSnick,
"highestTR": highestTR, "highestTR": highestTR,
"highestTRid": highestTRid, "highestTRid": highestTRid,
"highestTRnick": highestTRnick, "highestTRnick": highestTRnick,
"highestGlicko": highestGlicko, "highestGlicko": highestGlicko,
"highestGlickoID": highestGlickoID, "highestGlickoID": highestGlickoID,
"highestGlickoNick": highestGlickoNick, "highestGlickoNick": highestGlickoNick,
"highestRD": highestRD,
"highestRdID": highestRdID,
"highestRdNick": highestRdNick,
"highestGamesPlayed": highestGamesPlayed, "highestGamesPlayed": highestGamesPlayed,
"highestGamesPlayedID": highestGamesPlayedID, "highestGamesPlayedID": highestGamesPlayedID,
"highestGamesPlayedNick": highestGamesPlayedNick, "highestGamesPlayedNick": highestGamesPlayedNick,
@ -1095,6 +1415,66 @@ class TetrioPlayersLeaderboard {
"highestVS": highestVS, "highestVS": highestVS,
"highestVSid": highestVSid, "highestVSid": highestVSid,
"highestVSnick": highestVSnick, "highestVSnick": highestVSnick,
"highestAPP": highestAPP,
"highestAPPid": highestAPPid,
"highestAPPnick": highestAPPnick,
"highestVSAPM": highestVSAPM,
"highestVSAPMid": highestVSAPMid,
"highestVSAPMnick": highestVSAPMnick,
"highestDSS": highestDSS,
"highestDSSid": highestDSSid,
"highestDSSnick": highestDSSnick,
"highestDSP": highestDSP,
"highestDSPid": highestDSPid,
"highestDSPnick": highestDSPnick,
"highestAPPDSP": highestAPPDSP,
"highestAPPDSPid": highestAPPDSPid,
"highestAPPDSPnick": highestAPPDSPnick,
"highestCheese": highestCheese,
"highestCheeseID": highestCheeseID,
"highestCheeseNick": highestCheeseNick,
"highestGBE": highestGBE,
"highestGBEid": highestGBEid,
"highestGBEnick": highestGBEnick,
"highestNyaAPP": highestNyaAPP,
"highestNyaAPPid": highestNyaAPPid,
"highestNyaAPPnick": highestNyaAPPnick,
"highestArea": highestArea,
"highestAreaID": highestAreaID,
"highestAreaNick": highestAreaNick,
"highestEstTR": highestEstTR,
"highestEstTRid": highestEstTRid,
"highestEstTRnick": highestEstTRnick,
"highestEstAcc": highestEstAcc,
"highestEstAccID": highestEstAccID,
"highestEstAccNick": highestEstAccNick,
"highestOpener": highestOpener,
"highestOpenerID": highestOpenerID,
"highestOpenerNick": highestOpenerNick,
"highestPlonk": highestPlonk,
"highestPlonkID": highestPlonkID,
"highestPlonkNick": highestPlonkNick,
"highestStride": highestStride,
"highestStrideID": highestStrideID,
"highestStrideNick": highestStrideNick,
"highestInfDS": highestInfDS,
"highestInfDSid": highestInfDSid,
"highestInfDSnick": highestInfDSnick,
"avgAPP": avgAPP,
"avgVSAPM": avgVSAPM,
"avgDSS": avgDSS,
"avgDSP": avgDSP,
"avgAPPDSP": avgAPPDSP,
"avgCheese": avgCheese,
"avgGBE": avgGBE,
"avgNyaAPP": avgNyaAPP,
"avgArea": avgArea,
"avgEstTR": avgEstTR,
"avgEstAcc": avgEstAcc,
"avgOpener": avgOpener,
"avgPlonk": avgPlonk,
"avgStride": avgStride,
"avgInfDS": avgInfDS,
"toEnterTR": rank.toLowerCase() != "z" ? leaderboard[(leaderboard.length * rankCutoffs[rank]!).floor()-1].rating : lowestTR, "toEnterTR": rank.toLowerCase() != "z" ? leaderboard[(leaderboard.length * rankCutoffs[rank]!).floor()-1].rating : lowestTR,
"entries": filtredLeaderboard "entries": filtredLeaderboard
}]; }];
@ -1155,6 +1535,9 @@ class TetrioPlayerFromLeaderboard {
late double pps; late double pps;
late double vs; late double vs;
late bool decaying; late bool decaying;
late NerdStats nerdStats;
late EstTr estTr;
late Playstyle playstyle;
TetrioPlayerFromLeaderboard( TetrioPlayerFromLeaderboard(
this.userId, this.userId,
@ -1178,8 +1561,7 @@ class TetrioPlayerFromLeaderboard {
this.decaying); this.decaying);
double get winrate => gamesWon / gamesPlayed; double get winrate => gamesWon / gamesPlayed;
get app => apm / (pps * 60); double get esttracc => estTr.esttr - rating;
get vsapm => vs / apm;
TetrioPlayerFromLeaderboard.fromJson(Map<String, dynamic> json, DateTime ts) { TetrioPlayerFromLeaderboard.fromJson(Map<String, dynamic> json, DateTime ts) {
userId = json['_id']; userId = json['_id'];
@ -1201,5 +1583,8 @@ class TetrioPlayerFromLeaderboard {
pps = json['league']['pps'].toDouble(); pps = json['league']['pps'].toDouble();
vs = json['league']['vs'].toDouble(); vs = json['league']['vs'].toDouble();
decaying = json['league']['decaying']; decaying = json['league']['decaying'];
nerdStats = NerdStats(apm, pps, vs);
estTr = EstTr(apm, pps, vs, rd, nerdStats.app, nerdStats.dss, nerdStats.dsp, nerdStats.gbe);
playstyle = Playstyle(apm, pps, nerdStats.app, nerdStats.vsapm, nerdStats.dsp, nerdStats.gbe, estTr.srarea, estTr.statrank);
} }
} }

View File

@ -168,7 +168,7 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
fontFamily: fontFamily:
"Eurostile Round Extended")), "Eurostile Round Extended")),
subtitle: Text( subtitle: Text(
"${f2.format(widget.rank[1]["entries"][index].apm)} APM, ${f2.format(widget.rank[1]["entries"][index].pps)} PPS, ${f2.format(widget.rank[1]["entries"][index].vs)} VS, ${f2.format(widget.rank[1]["entries"][index].app)} APP, ${f2.format(widget.rank[1]["entries"][index].vsapm)} VS/APM"), "${f2.format(widget.rank[1]["entries"][index].apm)} APM, ${f2.format(widget.rank[1]["entries"][index].pps)} PPS, ${f2.format(widget.rank[1]["entries"][index].vs)} VS, ${f2.format(widget.rank[1]["entries"][index].nerdStats.app)} APP, ${f2.format(widget.rank[1]["entries"][index].nerdStats.vsapm)} VS/APM"),
trailing: Row( trailing: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -222,6 +222,13 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
username: widget.rank[1]["lowestGlickoNick"], username: widget.rank[1]["lowestGlickoNick"],
approximate: false, approximate: false,
fractionDigits: 2), fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["lowestRD"],
label: "Rating Deviation",
id: widget.rank[1]["lowestRdID"],
username: widget.rank[1]["lowestRdNick"],
approximate: false,
fractionDigits: 3),
_ListEntry( _ListEntry(
value: widget.rank[1]["lowestGamesPlayed"], value: widget.rank[1]["lowestGamesPlayed"],
label: "Games Played", label: "Games Played",
@ -263,14 +270,298 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
id: widget.rank[1]["lowestVSid"], id: widget.rank[1]["lowestVSid"],
username: widget.rank[1]["lowestVSnick"], username: widget.rank[1]["lowestVSnick"],
approximate: false, approximate: false,
fractionDigits: 2) fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["lowestAPP"],
label: t.statCellNum.app.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestAPPid"],
username: widget.rank[1]["lowestAPPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestVSAPM"],
label: "VS / APM",
id: widget.rank[1]["lowestVSAPMid"],
username: widget.rank[1]["lowestVSAPMnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestDSS"],
label: t.statCellNum.dss.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestDSSid"],
username: widget.rank[1]["lowestDSSnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestDSP"],
label: t.statCellNum.dsp.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestDSPid"],
username: widget.rank[1]["lowestDSPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestAPPDSP"],
label: t.statCellNum.dsp.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestAPPDSPid"],
username: widget.rank[1]["lowestAPPDSPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestCheese"],
label: t.statCellNum.cheese.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestCheeseID"],
username: widget.rank[1]["lowestCheeseNick"],
approximate: false,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["lowestGBE"],
label: t.statCellNum.gbe.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestGBEid"],
username: widget.rank[1]["lowestGBEnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestNyaAPP"],
label: t.statCellNum.nyaapp.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestNyaAPPid"],
username: widget.rank[1]["lowestNyaAPPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestArea"],
label: t.statCellNum.area.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestAreaID"],
username: widget.rank[1]["lowestAreaNick"],
approximate: false,
fractionDigits: 1),
_ListEntry(
value: widget.rank[1]["lowestEstTR"],
label: t.statCellNum.estOfTR.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestEstTRid"],
username: widget.rank[1]["lowestEstTRnick"],
approximate: false,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["lowestEstAcc"],
label: t.statCellNum.accOfEst.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["lowestEstAccID"],
username: widget.rank[1]["lowestEstAccNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestOpener"],
label: "Opener",
id: widget.rank[1]["lowestOpenerID"],
username: widget.rank[1]["lowestOpenerNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestPlonk"],
label: "Plonk",
id: widget.rank[1]["lowestPlonkID"],
username: widget.rank[1]["lowestPlonkNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestStride"],
label: "Stride",
id: widget.rank[1]["lowestStrideID"],
username: widget.rank[1]["lowestStrideNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["lowestInfDS"],
label: "InfDS",
id: widget.rank[1]["lowestInfDSid"],
username: widget.rank[1]["lowestInfDSnick"],
approximate: false,
fractionDigits: 3)
], ],
), ),
), ),
], ],
), ),
Column( Column(
children: [], children: [
Text("Average Values",
style: TextStyle(
fontFamily: "Eurostile Round Extended",
fontSize: bigScreen ? 42 : 28)),
Expanded(
child: ListView(
children: [
_ListEntry(
value: widget.rank[0].rating,
label: "Tetra Rating",
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[0].glicko,
label: "Glicko",
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[0].rd,
label: "Rating Deviation",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[0].gamesPlayed,
label: "Games Played",
id: "",
username: "",
approximate: true,
fractionDigits: 0),
_ListEntry(
value: widget.rank[0].gamesWon,
label: "Games Won",
id: "",
username: "",
approximate: true,
fractionDigits: 0),
_ListEntry(
value: widget.rank[0].winrate*100,
label: "Winrate",
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[0].apm,
label: "Attack per Minute",
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[0].pps,
label: "Pieces per Second",
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[0].vs,
label: "Versus Score",
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["avgAPP"],
label: "Attack Per Piece",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgAPP"],
label: "VS / APM",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgDSS"],
label: t.statCellNum.dss.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgDSP"],
label: t.statCellNum.dsp.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgAPPDSP"],
label: t.statCellNum.dsp.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgCheese"],
label: t.statCellNum.cheese.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["avgGBE"],
label: t.statCellNum.gbe.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgNyaAPP"],
label: t.statCellNum.nyaapp.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgArea"],
label: t.statCellNum.area.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 1),
_ListEntry(
value: widget.rank[1]["avgEstTR"],
label: t.statCellNum.estOfTR.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["avgEstAcc"],
label: t.statCellNum.accOfEst.replaceAll(RegExp(r'\n'), " "),
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgOpener"],
label: "Opener",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgPlonk"],
label: "Plonk",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgStride"],
label: "Stride",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["avgInfDS"],
label: "InfDS",
id: "",
username: "",
approximate: true,
fractionDigits: 3),
]
)
)
],
), ),
Column( Column(
children: [ children: [
@ -295,6 +586,13 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
username: widget.rank[1]["highestGlickoNick"], username: widget.rank[1]["highestGlickoNick"],
approximate: false, approximate: false,
fractionDigits: 2), fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["highestRD"],
label: "Rating Deviation",
id: widget.rank[1]["highestRdID"],
username: widget.rank[1]["highestRdNick"],
approximate: false,
fractionDigits: 3),
_ListEntry( _ListEntry(
value: widget.rank[1]["highestGamesPlayed"], value: widget.rank[1]["highestGamesPlayed"],
label: "Games Played", label: "Games Played",
@ -337,7 +635,112 @@ class RankState extends State<RankView> with SingleTickerProviderStateMixin {
id: widget.rank[1]["highestVSid"], id: widget.rank[1]["highestVSid"],
username: widget.rank[1]["highestVSnick"], username: widget.rank[1]["highestVSnick"],
approximate: false, approximate: false,
fractionDigits: 2) fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["highestAPP"],
label: t.statCellNum.app.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestAPPid"],
username: widget.rank[1]["highestAPPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestVSAPM"],
label: "VS / APM",
id: widget.rank[1]["highestVSAPMid"],
username: widget.rank[1]["highestVSAPMnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestDSS"],
label: t.statCellNum.dss.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestDSSid"],
username: widget.rank[1]["highestDSSnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestDSP"],
label: t.statCellNum.dsp.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestDSPid"],
username: widget.rank[1]["highestDSPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestAPPDSP"],
label: t.statCellNum.dsp.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestAPPDSPid"],
username: widget.rank[1]["highestAPPDSPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestCheese"],
label: t.statCellNum.cheese.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestCheeseID"],
username: widget.rank[1]["highestCheeseNick"],
approximate: false,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["highestGBE"],
label: t.statCellNum.gbe.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestGBEid"],
username: widget.rank[1]["highestGBEnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestNyaAPP"],
label: t.statCellNum.nyaapp.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestNyaAPPid"],
username: widget.rank[1]["highestNyaAPPnick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestArea"],
label: t.statCellNum.area.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestAreaID"],
username: widget.rank[1]["highestAreaNick"],
approximate: false,
fractionDigits: 1),
_ListEntry(
value: widget.rank[1]["highestEstTR"],
label: t.statCellNum.estOfTR.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestEstTRid"],
username: widget.rank[1]["highestEstTRnick"],
approximate: false,
fractionDigits: 2),
_ListEntry(
value: widget.rank[1]["highestEstAcc"],
label: t.statCellNum.accOfEst.replaceAll(RegExp(r'\n'), " "),
id: widget.rank[1]["highestEstAccID"],
username: widget.rank[1]["highestEstAccNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestOpener"],
label: "Opener",
id: widget.rank[1]["highestOpenerID"],
username: widget.rank[1]["highestOpenerNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestPlonk"],
label: "Plonk",
id: widget.rank[1]["highestPlonkID"],
username: widget.rank[1]["highestPlonkNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestStride"],
label: "Stride",
id: widget.rank[1]["highestStrideID"],
username: widget.rank[1]["highestStrideNick"],
approximate: false,
fractionDigits: 3),
_ListEntry(
value: widget.rank[1]["highestInfDS"],
label: "InfDS",
id: widget.rank[1]["highestInfDSid"],
username: widget.rank[1]["highestInfDSnick"],
approximate: false,
fractionDigits: 3),
], ],
), ),
) )
@ -374,6 +777,7 @@ class _ListEntry extends StatelessWidget {
return ListTile( return ListTile(
title: Text(label), title: Text(label),
trailing: Column( trailing: Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text(f.format(value), Text(f.format(value),

View File

@ -83,7 +83,7 @@ class TLLeaderboardState extends State<TLLeaderboardView> {
leading: Text((index+1).toString(), style: bigScreen ? const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28) : null), leading: Text((index+1).toString(), style: bigScreen ? const TextStyle(fontFamily: "Eurostile Round Extended", fontSize: 28) : null),
title: Text(allPlayers[index].username, style: const TextStyle(fontFamily: "Eurostile Round Extended")), title: Text(allPlayers[index].username, style: const TextStyle(fontFamily: "Eurostile Round Extended")),
subtitle: Text( subtitle: Text(
"${f2.format(allPlayers[index].apm)} APM, ${f2.format(allPlayers[index].pps)} PPS, ${f2.format(allPlayers[index].vs)} VS, ${f2.format(allPlayers[index].app)} APP, ${f2.format(allPlayers[index].vsapm)} VS/APM"), "${f2.format(allPlayers[index].apm)} APM, ${f2.format(allPlayers[index].pps)} PPS, ${f2.format(allPlayers[index].vs)} VS, ${f2.format(allPlayers[index].nerdStats.app)} APP, ${f2.format(allPlayers[index].nerdStats.vsapm)} VS/APM"),
trailing: Row( trailing: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [