player-id.js 549 B

1234567891011121314151617181920212223242526
  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. setSocket(socket) {
  10. this.playerSocket = socket;
  11. }
  12. setPlayerName(playerName) {
  13. this.playerName = playerName;
  14. }
  15. setPlayerColor(playerColor) {
  16. this.playerColor = playerColor;
  17. }
  18. setConnected(connected) {
  19. this.isConnected = connected;
  20. }
  21. isConnected() {
  22. return this.isConnected;
  23. }
  24. }