iliran11 / typing-game-2

2 stars 0 forks source link

Helpers for getting room and Player Objects from socket #2

Closed iliran11 closed 5 years ago

iliran11 commented 5 years ago

*socket is a general name for player identifier. in case on human it is io.Socket, and in case on BOT it is just a string.

code example - allocatePlayerToRoom.ts

  const player = playerManager.getPlayer(socket);
  const room = RoomManager.getInstance().addPlayer(player);