Skip to content

Commit b7adaec

Browse files
authored
District Champs (#41)
* District Champs * Add megacity * Ubuntu latest * Ubuntu latest * missed one
1 parent efd8b48 commit b7adaec

File tree

9 files changed

+31
-7
lines changed

9 files changed

+31
-7
lines changed

.github/workflows/check-css.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
strategy:
99
matrix:
1010
node-version: [ "20.x" ]

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44

55
jobs:
66
build:
7-
runs-on: ubuntu-20.04
7+
runs-on: ubuntu-latest
88
strategy:
99
matrix:
1010
node-version: [ "20.x" ]

api/src/lib/abr.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export enum ABRTournamentTypeFilter {
3232
CircuitBreaker = 13,
3333
IntercontinentalChampionship = 14,
3434
PlayersCircuit = 15,
35+
DistrictChampionship = 16,
36+
MegaCityChampionship = 17,
3537
}
3638

3739
export const ABRTournament = z.object({

api/src/lib/ranking.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ import type { TournamentType } from "../schema.js";
55
export enum Tournament {
66
Worlds = "worlds championship",
77
Continental = "continental championship",
8-
National = "national championship",
9-
Intercontinental = "intercontinental championship",
8+
DistrictChampionship = "district championship",
9+
MegaCityChampionship = "megacity championship",
1010
CircuitOpener = "circuit opener",
1111
CircuitBreaker = "circuit breaker",
12+
CasualTournamentKit = "casual tournament kit",
13+
National = "national championship",
1214
CircuitBreakerInvitational = "circuit breaker invitational",
1315
PlayersCircuit = "players circuit",
14-
CasualTournamentKit = "casual tournament kit",
16+
Intercontinental = "intercontinental championship",
1517
}
1618

1719
// Default configuration (Season 0)
@@ -28,6 +30,8 @@ export const DEFAULT_CONFIG: Record<string, Record<Tournament, number>> = {
2830
[Tournament.CircuitBreakerInvitational]: 2,
2931
[Tournament.PlayersCircuit]: 2,
3032
[Tournament.CasualTournamentKit]: 1,
33+
[Tournament.DistrictChampionship]: 1.2,
34+
[Tournament.MegaCityChampionship]: 1.5,
3135
},
3236
// Flat points added to the total point pool that gets awarded to 1st place
3337
// Each tournament gets a different point total to reflect the tournament prestige
@@ -41,6 +45,8 @@ export const DEFAULT_CONFIG: Record<string, Record<Tournament, number>> = {
4145
[Tournament.CircuitBreakerInvitational]: 200,
4246
[Tournament.PlayersCircuit]: 25,
4347
[Tournament.CasualTournamentKit]: 15,
48+
[Tournament.DistrictChampionship]: 0,
49+
[Tournament.MegaCityChampionship]: 0,
4450
},
4551
// Sets a baseline number of players a tournament must have in order to distribute any points at all
4652
// This means that small tournaments are not eligible for payouts
@@ -54,6 +60,8 @@ export const DEFAULT_CONFIG: Record<string, Record<Tournament, number>> = {
5460
[Tournament.CircuitBreakerInvitational]: 8,
5561
[Tournament.PlayersCircuit]: 8,
5662
[Tournament.CasualTournamentKit]: 8,
63+
[Tournament.DistrictChampionship]: 8,
64+
[Tournament.MegaCityChampionship]: 8,
5765
},
5866
// Defines the max number of tournaments a person can get points for
5967
// We take the top values if a person attends more than the defined max
@@ -67,6 +75,8 @@ export const DEFAULT_CONFIG: Record<string, Record<Tournament, number>> = {
6775
[Tournament.CircuitBreakerInvitational]: 1,
6876
[Tournament.PlayersCircuit]: 1,
6977
[Tournament.CasualTournamentKit]: 5,
78+
[Tournament.DistrictChampionship]: 3,
79+
[Tournament.MegaCityChampionship]: 2,
7080
},
7181
// Defines the bottom anchor point which means the last place player will receive less than the value provided
7282
// This is used to help set the rate of decay and the payout slope. A higher number indicates a more gradual slope
@@ -80,6 +90,8 @@ export const DEFAULT_CONFIG: Record<string, Record<Tournament, number>> = {
8090
[Tournament.CircuitBreakerInvitational]: 1,
8191
[Tournament.PlayersCircuit]: 1,
8292
[Tournament.CasualTournamentKit]: 1,
93+
[Tournament.DistrictChampionship]: 1,
94+
[Tournament.MegaCityChampionship]: 1,
8395
},
8496
};
8597

@@ -97,6 +109,8 @@ export const SEASON_3_CONFIG = {
97109
[Tournament.CircuitBreakerInvitational]: 0,
98110
[Tournament.PlayersCircuit]: 0,
99111
[Tournament.CasualTournamentKit]: 0,
112+
[Tournament.DistrictChampionship]: 0,
113+
[Tournament.MegaCityChampionship]: 0,
100114
},
101115
POINTS_PER_PLAYER: {
102116
...DEFAULT_CONFIG.POINTS_PER_PLAYER,
@@ -110,6 +124,8 @@ export const SEASON_3_CONFIG = {
110124
[Tournament.CircuitBreakerInvitational]: 1,
111125
[Tournament.PlayersCircuit]: 1,
112126
[Tournament.CasualTournamentKit]: 1,
127+
[Tournament.DistrictChampionship]: 1.1,
128+
[Tournament.MegaCityChampionship]: 1.25,
113129
},
114130
};
115131

api/src/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export enum TournamentType {
1818
REGIONAL_CHAMPIONSHIP = "regional championship",
1919
PLAYERS_CIRCUIT = "players circuit",
2020
CASUAL_TOURNAMENT_KIT = "casual tournament kit",
21+
DISTRICT_CHAMPIONSHIP = "district championship",
22+
MEGA_CITY_CHAMPIONSHIP = "megacity championship",
2123
}
2224

2325
export type Format = "standard" | "startup" | "eternal" | "other";

app/src/client/models/RankingConfig.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ export type RankingConfig = {
2525
'regional championship'?: TournamentConfig;
2626
'players circuit'?: TournamentConfig;
2727
'casual tournament kit'?: TournamentConfig;
28+
'district championship'?: TournamentConfig;
29+
'megacity championship'?: TournamentConfig;
2830
};
2931
};
3032

app/src/client/models/TournamentType.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ export enum TournamentType {
2121
REGIONAL_CHAMPIONSHIP = 'regional championship',
2222
PLAYERS_CIRCUIT = 'players circuit',
2323
CASUAL_TOURNAMENT_KIT = 'casual tournament kit',
24+
DISTRICT_CHAMPIONSHIP = 'district championship',
25+
MEGACITY_CHAMPIONSHIP = 'megacity championship',
2426
}

app/src/client/services/AdminService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export class AdminService {
2929
public static postIngestTournament(
3030
requestBody?: {
3131
userId?: number;
32-
tournamentType?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
32+
tournamentType?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17;
3333
},
3434
): CancelablePromise<any> {
3535
return __request(OpenAPI, {

spec.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)