deck and factory work together, resolve pbs
continuous-integration/drone/push Build is passing Details

pull/59/head^2^2
Bastien JACQUELIN 2 years ago
parent 6e6826efb5
commit 8b1a51cb40

@ -12,10 +12,6 @@ class Deck{
this.outputCards=[];// 12 cards lay on the table this.outputCards=[];// 12 cards lay on the table
this.setMade=[];// array of array with all the set already mades (array of set) this.setMade=[];// array of array with all the set already mades (array of set)
this.createDeck(12); 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; 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 * @author Bastien Jacquelin
*/ */
createDeck(nbCards){//toTest⌛ createDeck(nbCards){//toTest⌛
@ -44,6 +40,8 @@ class Deck{
} }
let nbSets=setsCounter(this.outputCards,this.nbCards); let nbSets=setsCounter(this.outputCards,this.nbCards);
console.log("nbSets",nbSets); console.log("nbSets",nbSets);
console.log("outputCards.length",this.outputCards.length);
console.log("remainingCards.length",this.remainingCards.length);
if(nbSets==0){ if(nbSets==0){
this.createDeck(this.nbCards) this.createDeck(this.nbCards)
} }
@ -103,7 +101,6 @@ class Deck{
throw new UnFoundCardException(selectedCards); throw new UnFoundCardException(selectedCards);
} }
else{ else{
console.log("set",set);
this.setMade.push(set); this.setMade.push(set);
this.createDeck(this.nbCards) this.createDeck(this.nbCards)
} }

@ -4,9 +4,9 @@ class Factory{
this.dicoAttributes=this.attributesDictionnary(arrayOfAttributes,this.funArrayOfAttributes(arrayOfAttributes)); this.dicoAttributes=this.attributesDictionnary(arrayOfAttributes,this.funArrayOfAttributes(arrayOfAttributes));
this.product=this.concreteCardCreation(arrayOfAttributes); this.product=this.concreteCardCreation(arrayOfAttributes);
// console.log("arrayOfAttributes",this.funArrayOfAttributes(arrayOfAttributes)); // console.log("arrayOfAttributes",this.funArrayOfAttributes(arrayOfAttributes));
console.log("attributesDictionnary",this.dicoAttributes) // console.log("attributesDictionnary",this.dicoAttributes)
console.log("attributesName",this.attributesName(this.dicoAttributes)); // console.log("attributesName",this.attributesName(this.dicoAttributes));
console.log("allCards",this.product); // console.log("allCards",this.product);
} }
/** /**

Loading…
Cancel
Save