tangled
alpha
login
or
join now
alpine.girlfag.club
/
refbot
0
fork
atom
SpinShare Referee Bot
refbot.ellite.dev/overlay
0
fork
atom
overview
issues
13
pulls
pipelines
use bestOf to calculate match chart ammounts
alpinesystem
3 weeks ago
84e77a14
d7e6c9a1
+54
-54
2 changed files
expand all
collapse all
unified
split
Brackets.json
state
poolGenerator.js
+48
-48
Brackets.json
···
4
4
"rounds": [
5
5
{
6
6
"name": "Winners Semi-Final",
7
7
-
"pool": 0,
7
7
+
"tier": 1,
8
8
"matches": 2,
9
9
-
"charts": 5
9
9
+
"bestOf": 3
10
10
},
11
11
{
12
12
"name": "Losers Semi-Final",
13
13
-
"pool": 0,
13
13
+
"tier": 1,
14
14
"matches": 1,
15
15
-
"charts": 5
15
15
+
"bestOf": 3
16
16
},
17
17
{
18
18
"name": "Losers Final",
19
19
-
"pool": 1,
19
19
+
"tier": 2,
20
20
"matches": 1,
21
21
-
"charts": 5
21
21
+
"bestOf": 3
22
22
},
23
23
{
24
24
"name": "Winners Final",
25
25
-
"pool": 1,
25
25
+
"tier": 2,
26
26
"matches": 1,
27
27
-
"charts": 5
27
27
+
"bestOf": 3
28
28
},
29
29
{
30
30
"name": "Grand Final",
31
31
-
"pool": 1,
31
31
+
"tier": 2,
32
32
"matches": 1,
33
33
-
"charts": 5
33
33
+
"bestOf": 3
34
34
},
35
35
{
36
36
"name": "Grand Final Reset",
37
37
-
"pool": 1,
37
37
+
"tier": 2,
38
38
"matches": 1,
39
39
-
"charts": 5
39
39
+
"bestOf": 3
40
40
}
41
41
]
42
42
},
···
45
45
"rounds": [
46
46
{
47
47
"name": "Winners Quarter-Final",
48
48
-
"pool": 1,
48
48
+
"tier": 2,
49
49
"matches": 4,
50
50
-
"charts": 7
50
50
+
"bestOf": 5
51
51
},
52
52
{
53
53
"name": "Winners Semi-Final",
54
54
-
"pool": 2,
54
54
+
"tier": 3,
55
55
"matches": 2,
56
56
-
"charts": 9
56
56
+
"bestOf": 7
57
57
},
58
58
{
59
59
"name": "Winners Final",
60
60
-
"pool": 2,
60
60
+
"tier": 3,
61
61
"matches": 1,
62
62
-
"charts": 11
62
62
+
"bestOf": 9
63
63
},
64
64
{
65
65
"name": "Losers Round 1",
66
66
-
"pool": 1,
66
66
+
"tier": 2,
67
67
"matches": 2,
68
68
-
"charts": 7
68
68
+
"bestOf": 5
69
69
},
70
70
{
71
71
"name": "Losers Quarter-Final",
72
72
-
"pool": 2,
72
72
+
"tier": 3,
73
73
"matches": 2,
74
74
-
"charts": 7
74
74
+
"bestOf": 5
75
75
},
76
76
{
77
77
"name": "Losers Semi-Final",
78
78
-
"pool": 2,
78
78
+
"tier": 3,
79
79
"matches": 1,
80
80
-
"charts": 9
80
80
+
"bestOf": 7
81
81
},
82
82
{
83
83
"name": "Losers Final",
84
84
-
"pool": 2,
84
84
+
"tier": 3,
85
85
"matches": 1,
86
86
-
"charts": 9
86
86
+
"bestOf": 7
87
87
},
88
88
{
89
89
"name": "Grand Final",
90
90
-
"pool": 2,
90
90
+
"tier": 3,
91
91
"matches": 1,
92
92
-
"charts": 11,
92
92
+
"bestOf": 9,
93
93
"hardestOnly": true
94
94
},
95
95
{
96
96
"name": "Grand Final (Reset)",
97
97
-
"pool": 2,
97
97
+
"tier": 3,
98
98
"matches": 1,
99
99
-
"charts": 11,
99
99
+
"bestOf": 9,
100
100
"hardestOnly": true
101
101
}
102
102
]
···
106
106
"rounds": [
107
107
{
108
108
"name": "Winners Quarter-Final",
109
109
-
"pool": 2,
109
109
+
"tier": 3,
110
110
"matches": 4,
111
111
-
"charts": 7
111
111
+
"bestOf": 5
112
112
},
113
113
{
114
114
"name": "Winners Semi-Final",
115
115
-
"pool": 3,
115
115
+
"tier": 4,
116
116
"matches": 2,
117
117
-
"charts": 9
117
117
+
"bestOf": 5
118
118
},
119
119
{
120
120
"name": "Winners Final",
121
121
-
"pool": 3,
121
121
+
"tier": 4,
122
122
"matches": 1,
123
123
-
"charts": 11
123
123
+
"bestOf": 9
124
124
},
125
125
{
126
126
"name": "Losers Round 1",
127
127
-
"pool": 2,
127
127
+
"tier": 3,
128
128
"matches": 2,
129
129
-
"charts": 7
129
129
+
"bestOf": 5
130
130
},
131
131
{
132
132
"name": "Losers Quarter-Final",
133
133
-
"pool": 3,
133
133
+
"tier": 4,
134
134
"matches": 2,
135
135
-
"charts": 7
135
135
+
"bestOf": 5
136
136
},
137
137
{
138
138
"name": "Losers Semi-Final",
139
139
-
"pool": 3,
139
139
+
"tier": 4,
140
140
"matches": 1,
141
141
-
"charts": 9
141
141
+
"bestOf": 7
142
142
},
143
143
{
144
144
"name": "Losers Final",
145
145
-
"pool": 3,
145
145
+
"tier": 4,
146
146
"matches": 1,
147
147
-
"charts": 9
147
147
+
"bestOf": 7
148
148
},
149
149
{
150
150
"name": "Grand Final",
151
151
-
"pool": 3,
151
151
+
"tier": 4,
152
152
"matches": 1,
153
153
-
"charts": 11,
153
153
+
"bestOf": 9,
154
154
"hardestOnly": true
155
155
},
156
156
{
157
157
"name": "Grand Final (Reset)",
158
158
-
"pool": 3,
158
158
+
"tier": 4,
159
159
"matches": 1,
160
160
-
"charts": 11,
160
160
+
"bestOf": 9,
161
161
"hardestOnly": true
162
162
}
163
163
]
+6
-6
state/poolGenerator.js
···
38
38
const bracketResult = { name: bracket.name, rounds: [] };
39
39
40
40
for (const roundConfig of bracket.rounds) {
41
41
-
const tier = roundConfig.pool + 1;
42
42
-
const charts = tierPools[tier];
43
43
-
if (!charts || charts.length === 0) continue;
41
41
+
const tiercharts = tierPools[roundConfig.tier];
42
42
+
if (!tiercharts || tiercharts.length === 0) continue;
44
43
45
45
-
const pool = makePool(charts);
44
44
+
const pool = makePool(tiercharts);
46
45
const matches = [];
47
46
48
47
for (let k = 0; k < roundConfig.matches; k++) {
48
48
+
const charts = roundConfig.bestOf + 2;
49
49
const match = roundConfig.hardestOnly
50
50
-
? pool.getHardest(roundConfig.charts)
51
51
-
: pool.getRandom(roundConfig.charts, random);
50
50
+
? pool.getHardest(charts)
51
51
+
: pool.getRandom(charts, random);
52
52
matches.push(match);
53
53
}
54
54