fix de l'ordre des soumissions

This commit is contained in:
Haïssous Kayyissa 2023-04-05 16:35:52 +02:00
parent c313f2846e
commit a1622fa86c
2 changed files with 7 additions and 4 deletions

View File

@ -39,6 +39,7 @@ public class GameView extends View {
//affichage des anciennes soumissions
LinkedList<Integer> grille = new LinkedList<Integer>();
grille.addAll(this.grille.getSoumissions());
System.out.println(grille.size());
for (int y=0; y<10;y++) {
for (int x=0;x<4;x++) {
this.circle.setColor(grille.pop());

View File

@ -21,11 +21,13 @@ public class Grille {
}
public void addSoumission(LinkedList<Integer> newSub){
for (int i=4;i>0;i--){
System.out.println("i="+i+", new sub="+newSub);
this.soumissions.set(this.soumissions.size()-this.sizeSubs*4-i,newSub.pop());
if (this.sizeSubs<10) {
for (int i = 4; i > 0; i--) {
this.soumissions.remove(0);
this.soumissions.addLast(newSub.poll());
}
this.sizeSubs += 1;
}
this.sizeSubs+=1;
}
public void initGrille(Collection<Integer> SubToCopy){