player-id.js 595 B

1234567891011121314151617181920212223242526272829
  1. 'use strict';
  2. export default class PlayerId {
  3. constructor(playerName = '', playerColor = 'unk') {
  4. this.playerSocket = null;
  5. this.playerName = playerName;
  6. this.playerColor = playerColor;
  7. this.connected=false;
  8. }
  9. getSocket() {
  10. return this.playerSocket;
  11. }
  12. setSocket(socket) {
  13. this.playerSocket = socket;
  14. }
  15. setPlayerName(playerName) {
  16. this.playerName = playerName;
  17. }
  18. setPlayerColor(playerColor) {
  19. this.playerColor = playerColor;
  20. }
  21. setConnected(connected) {
  22. this.connected = connected;
  23. }
  24. isConnected() {
  25. return this.connected;
  26. }
  27. }