WIP, tout est en chantier, très content :)

This commit is contained in:
LuckyLaszlo
2022-11-20 15:46:45 +01:00
parent 023b5ed485
commit 48665cfe30
22 changed files with 580 additions and 302 deletions

View File

@@ -0,0 +1,32 @@
import {WebSocket} from "ws";
import {Racket} from "../../shared_js/class/Rectangle.js";
import { GameSession } from "./GameSession.js";
class Client {
socket: WebSocket;
id: string; // Pas indispensable si "socket" a une copie de "id"
isAlive: boolean;
gameSession: GameSession;
constructor(socket: WebSocket, id: string) {
this.socket = socket;
this.id = id;
this.isAlive = true;
}
}
class ClientPlayer extends Client {
racket: Racket;
constructor(socket: WebSocket, id: string, racket: Racket) {
super(socket, id);
this.racket = racket;
}
}
class ClientSpectator extends Client { // Wip, unused
constructor(socket: WebSocket, id: string) {
super(socket, id);
}
}
export {Client, ClientPlayer, ClientSpectator}