player-id.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. 'use strict';
  2. var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6. exports.default = void 0;
  7. var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
  8. var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
  9. var PlayerId = /*#__PURE__*/function () {
  10. function PlayerId() {
  11. var playerName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
  12. (0, _classCallCheck2.default)(this, PlayerId);
  13. this.playerSocket = null;
  14. this.playerName = playerName;
  15. this.connected = false;
  16. this.isPlayingGameId = -1;
  17. }
  18. (0, _createClass2.default)(PlayerId, [{
  19. key: "getSocket",
  20. value: function getSocket() {
  21. return this.playerSocket;
  22. }
  23. }, {
  24. key: "setSocket",
  25. value: function setSocket(socket) {
  26. this.playerSocket = socket;
  27. }
  28. }, {
  29. key: "setPlayerName",
  30. value: function setPlayerName(playerName) {
  31. this.playerName = playerName;
  32. }
  33. }, {
  34. key: "setPlayerColor",
  35. value: function setPlayerColor(playerColor) {
  36. this.playerColor = playerColor;
  37. }
  38. }, {
  39. key: "setConnected",
  40. value: function setConnected(connected) {
  41. this.connected = connected;
  42. }
  43. }, {
  44. key: "isConnected",
  45. value: function isConnected() {
  46. return this.connected;
  47. }
  48. }]);
  49. return PlayerId;
  50. }();
  51. exports.default = PlayerId;
  52. //# sourceMappingURL=player-id.js.map