[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2026-04-22 22:42:01 +00:00
parent 68c905f199
commit fc339e3ff1
3 changed files with 38 additions and 39 deletions
@@ -1,4 +1,3 @@
import type { Socket } from 'socket.io-client';
/**
@@ -6,45 +5,45 @@ import type { Socket } from 'socket.io-client';
* Still in development, but it will be used to avoid having socket calls directly in the svelte files, and to have a single place to manage all the game controls related socket calls.
*/
export class SocketGameControls {
socket: Socket;
socket: Socket;
constructor(socket: Socket) {
this.socket = socket;
}
constructor(socket: Socket) {
this.socket = socket;
}
set_question_number(q_number: number) {
this.socket.emit('set_question_number', q_number.toString());
};
}
get_question_results(game_id: string, question_number: number) {
this.socket.emit('get_question_results', {
game_id,
question_number
});
};
}
show_solutions() {
this.socket.emit('show_solutions', {});
};
}
get_final_results() {
this.socket.emit('get_final_results', {});
};
}
start_game() {
this.socket.emit('start_game', '');
}
start_game() {
this.socket.emit('start_game', '');
}
kick_player(username: string, players: any[]) {
this.socket.emit('kick_player', { username: username });
kick_player(username: string, players: any[]) {
this.socket.emit('kick_player', { username: username });
for (let i = 0; i < players.length; i++) {
console.log(players[i].username, username);
if (players[i].username === username) {
players.splice(i, 1);
break;
}
}
return players;
}
}
for (let i = 0; i < players.length; i++) {
console.log(players[i].username, username);
if (players[i].username === username) {
players.splice(i, 1);
break;
}
}
return players;
}
}