Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- let matching = Object.create(null);
- class Player {
- constructor(user) {
- user = Users(user);
- this.id = user.userid;
- this.user = user.name;
- this.cards = new Set();
- this.used = new Set();
- this.points = 0;
- }
- addCard(card) {
- this.cards.add(card);
- }
- usedCard(card) {
- this.removeCard(card);
- this.used.add(card);
- }
- removeCard(card) {
- this.cards.remove(card);
- }
- }
- class Game {
- constructor(room, options) {
- this.p1 = new Player(options.players[0]);
- this.p2 = new Player(options.players[1]);
- this.playersCap = 2;
- matching[`${this.p1.id}-${this.p2.id}`];
- }
- }
- module.exports = Game;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement