Advertisement
Guest User

Untitled

a guest
Apr 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. 'use strict';
  2. let matching = Object.create(null);
  3.  
  4. class Player {
  5. constructor(user) {
  6. user = Users(user);
  7. this.id = user.userid;
  8. this.user = user.name;
  9. this.cards = new Set();
  10. this.used = new Set();
  11. this.points = 0;
  12. }
  13. addCard(card) {
  14. this.cards.add(card);
  15. }
  16. usedCard(card) {
  17. this.removeCard(card);
  18. this.used.add(card);
  19.  
  20. }
  21. removeCard(card) {
  22. this.cards.remove(card);
  23. }
  24. }
  25.  
  26. class Game {
  27. constructor(room, options) {
  28. this.p1 = new Player(options.players[0]);
  29. this.p2 = new Player(options.players[1]);
  30. this.playersCap = 2;
  31. matching[`${this.p1.id}-${this.p2.id}`];
  32. }
  33. }
  34.  
  35. module.exports = Game;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement