UNPKG

poker-odds-calc-test

Version:
25 lines (24 loc) 751 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const Card_1 = require("./Card"); class Deck { constructor(game) { this.game = game; this.cards = []; ["c", "d", "s", "h"].forEach((suit) => { let numbers = [6, 7, 8, 9, "T", "J", "Q", "K", "A"]; if (!game.isSixPlusTexasHoldem()) numbers = [2, 3, 4, 5].concat(numbers); numbers.forEach(num => { this.cards.push(new Card_1.default(suit, num, this.game)); }); }); } getCards() { return this.cards; } getAvailableCards() { return this.cards.filter(card => !card.inPlay()); } } exports.default = Deck;