2024-04-21 14:34:45 +02:00
|
|
|
export function makeApiUrl(path: string, protocol: 'http' | 'ws' = 'http') {
|
2024-04-22 21:26:46 +02:00
|
|
|
return new URL(`${protocol}://${window.location.hostname}${path}`);
|
2024-04-21 14:34:45 +02:00
|
|
|
}
|
|
|
|
|
2024-04-22 19:03:07 +02:00
|
|
|
export type Scores = {
|
|
|
|
readonly kills: number;
|
|
|
|
readonly deaths: number;
|
|
|
|
readonly wallsDestroyed: number;
|
2024-04-22 21:26:46 +02:00
|
|
|
readonly shotsFired: number;
|
|
|
|
readonly overallScore: number;
|
2024-04-29 13:54:29 +02:00
|
|
|
readonly powerUpsCollected: number;
|
2024-04-22 19:03:07 +02:00
|
|
|
};
|
|
|
|
|
2024-04-14 18:26:13 +02:00
|
|
|
export type Player = {
|
2024-04-13 17:56:33 +02:00
|
|
|
readonly name: string;
|
2024-04-22 19:03:07 +02:00
|
|
|
readonly scores: Scores;
|
2024-04-13 19:50:37 +02:00
|
|
|
};
|