From bfb83c514e13b1024922e0617dbbb05bd43ef2f5 Mon Sep 17 00:00:00 2001 From: Claire G Date: Sun, 9 Apr 2023 22:48:04 +0200 Subject: [PATCH] Visuel partie avec pion vide --- .../com/example/mastermind/ChoiceCombi.java | 15 +++++++++-- .../com/example/mastermind/GameActivity.java | 25 ++++++++++++++++--- .../com/example/mastermind/MainActivity.java | 12 +++------ .../example/mastermind/SettingsActivity.java | 2 +- .../com/example/mastermind/game/GameView.java | 13 +++++++--- 5 files changed, 50 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/example/mastermind/ChoiceCombi.java b/app/src/main/java/com/example/mastermind/ChoiceCombi.java index a0d60b9..fe4d2d1 100644 --- a/app/src/main/java/com/example/mastermind/ChoiceCombi.java +++ b/app/src/main/java/com/example/mastermind/ChoiceCombi.java @@ -14,12 +14,18 @@ public class ChoiceCombi extends Activity implements SaisieActivity { private Saisie saisie; private Integer[] combiGagnante; private Integer[] pions; + private boolean emptyPion; private View view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int[] tab = getIntent().getIntArrayExtra("pions"); - this.pions=new Integer[6]; + this.emptyPion = getIntent().getBooleanExtra("emptyPion", false); + if(emptyPion) { + this.pions=new Integer[7]; + } else { + this.pions=new Integer[6]; + } for (int i=0;i couleurs = new LinkedList(); couleurs.addAll(this.saisie.getChoix()); - for (int i=0;i