Add backend
This commit is contained in:
parent
4ad60813c9
commit
0f0a1eaf67
19 changed files with 355 additions and 45 deletions
13
backend/src/players/player-container.ts
Normal file
13
backend/src/players/player-container.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { Player } from './player';
|
||||
|
||||
export class PlayerContainer {
|
||||
private socketIdToPlayer = new Map<string, Player>();
|
||||
|
||||
public addPlayer(player: Player) {
|
||||
this.socketIdToPlayer.set(player.socketId, player);
|
||||
}
|
||||
|
||||
public removePlayerBySocketId(socketId: string) {
|
||||
this.socketIdToPlayer.delete(socketId);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue