mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +02:00
feat: position relative neighbor caching
This commit is contained in:
1 parent
aea01072fb
commit
c799534009
1 file changed
+8
-2
@@ -277,12 +277,18 @@ export default function Page() {
|
||||
if (!isMissing) return [];
|
||||
}
|
||||
|
||||
const seedingPlayerPosition = parseInt(
|
||||
Object.entries(players[region][season]).find(
|
||||
([, player]) => id === player.id,
|
||||
)![0],
|
||||
);
|
||||
const { neighbors } = await getRatingsNeighbors(region, id, size, true);
|
||||
|
||||
usePlayersCache.setState(
|
||||
produce((draft: PlayersCache) => {
|
||||
neighbors.forEach((neighbor) => {
|
||||
const position = neighbor.number - 1;
|
||||
neighbors.forEach((neighbor, neighborIndex) => {
|
||||
// const position = neighbor.number - 1;
|
||||
const position = neighborIndex - radius + seedingPlayerPosition;
|
||||
|
||||
if (!(position in draft[region][season])) {
|
||||
draft[region][season][position] = {
|
||||
|
||||
Reference in new issue
Block a user