diff --git a/src/Console/Console.html b/src/Console/Console.html index bc47ce5..1f6b5c3 100644 --- a/src/Console/Console.html +++ b/src/Console/Console.html @@ -14,6 +14,7 @@ + diff --git a/src/Model/Deck.js b/src/Model/Deck.js index 55d34bd..81ee4e8 100644 --- a/src/Model/Deck.js +++ b/src/Model/Deck.js @@ -1,5 +1,5 @@ class Deck{ - constructor(nbAttributes){ + constructor(nbAttributes=4){ this.allCards=this.createCards(nbAttributes);// All the cards in the game this.remainingCards=this.allCards;// cards in the stack this.outputCards=[];// 12 cards lay on the table @@ -17,6 +17,11 @@ class Deck{ const random = Math.floor(Math.random() * this.remainingCards.length); return random; } + /** + * + * @param {*} nbAttributes : attributes of the card, by default = 4 + * @returns all cards: 81 in case of 4 attributes and 1224 + */ createCards(nbAttributes){ const tabColor = ['red','purple','green','blue','orange']; const tabShape = ['diamond','oval','wave','star','circle'] @@ -42,4 +47,26 @@ class Deck{ } return tabOfAllCards; } + checkSet(selectedCards){ + if(true){//isSet(selectedCards)){ + selectedCards.forEach(e => { + this.removeFromRemainingCards(e); + }); + } + } + removeFromRemainingCards(selectedCards){ + let set=[]; + if (selectedCards instanceof Card) { + for(let i=0; i