From 8b1a51cb4064951a93eab1eef9b7206c9868d2c5 Mon Sep 17 00:00:00 2001 From: bajacqueli Date: Mon, 6 Mar 2023 23:02:50 +0100 Subject: [PATCH] deck and factory work together, resolve pbs --- src/Model/Deck.js | 9 +++------ src/Model/Factory.js | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Model/Deck.js b/src/Model/Deck.js index ce0cf47..3bef3cf 100644 --- a/src/Model/Deck.js +++ b/src/Model/Deck.js @@ -12,10 +12,6 @@ class Deck{ this.outputCards=[];// 12 cards lay on the table this.setMade=[];// array of array with all the set already mades (array of set) this.createDeck(12); - // console.log("allCards after deck",this.allCards); - console.log("remainingCards after deck",this.remainingCards); - console.log("outputCards",this.outputCards); - console.log("setMade",this.setMade); } /** * @@ -28,7 +24,7 @@ class Deck{ return factory.product; } /** - * @brief creation of the deck : 12 random cards lay in front of the player + * @brief creation of the deck : 12 random cards lay in front of the playe and remove card from the remainingCard array * @author Bastien Jacquelin */ createDeck(nbCards){//toTest⌛ @@ -44,6 +40,8 @@ class Deck{ } let nbSets=setsCounter(this.outputCards,this.nbCards); console.log("nbSets",nbSets); + console.log("outputCards.length",this.outputCards.length); + console.log("remainingCards.length",this.remainingCards.length); if(nbSets==0){ this.createDeck(this.nbCards) } @@ -103,7 +101,6 @@ class Deck{ throw new UnFoundCardException(selectedCards); } else{ - console.log("set",set); this.setMade.push(set); this.createDeck(this.nbCards) } diff --git a/src/Model/Factory.js b/src/Model/Factory.js index 2bb9061..d75e7ef 100644 --- a/src/Model/Factory.js +++ b/src/Model/Factory.js @@ -4,9 +4,9 @@ class Factory{ this.dicoAttributes=this.attributesDictionnary(arrayOfAttributes,this.funArrayOfAttributes(arrayOfAttributes)); this.product=this.concreteCardCreation(arrayOfAttributes); // console.log("arrayOfAttributes",this.funArrayOfAttributes(arrayOfAttributes)); - console.log("attributesDictionnary",this.dicoAttributes) - console.log("attributesName",this.attributesName(this.dicoAttributes)); - console.log("allCards",this.product); + // console.log("attributesDictionnary",this.dicoAttributes) + // console.log("attributesName",this.attributesName(this.dicoAttributes)); + // console.log("allCards",this.product); } /**