WIP, tout est en chantier, très content :)
This commit is contained in:
32
src/server/class/Client.ts
Normal file
32
src/server/class/Client.ts
Normal 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}
|
||||
Reference in New Issue
Block a user