From c14ad27b85993765e4b840b4beda408655bc1154 Mon Sep 17 00:00:00 2001 From: Claire G Date: Thu, 6 Apr 2023 14:30:40 +0200 Subject: [PATCH] Ajout emplacement notations --- .../com/example/mastermind/game/GameView.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/example/mastermind/game/GameView.java b/app/src/main/java/com/example/mastermind/game/GameView.java index d7f1fd5..8a4ff1d 100644 --- a/app/src/main/java/com/example/mastermind/game/GameView.java +++ b/app/src/main/java/com/example/mastermind/game/GameView.java @@ -69,12 +69,27 @@ public class GameView extends View { canvas.drawCircle((i*this.getWidth()*2/13+this.getWidth()/8),this.getHeight()-this.getHeight()/7, this.getWidth()/16, this.circle); } //TODO: ajout des colonnes de notation + LinkedList notation = new LinkedList(); + notation.addAll(this.grille.getNotations()); + for(int y=0; y<10; y++) { // colonne gauche + for(int x=0; x<2; x++) { + this.circle.setColor(notation.pop()); + canvas.drawCircle((x*this.getWidth()/11+(this.getWidth()/11)),(y*this.getHeight()/14+getHeight()/21), this.getWidth()/26, this.circle); + } + } + for(int y=0; y<10; y++) { // colonne droite + for(int x=0; x<2; x++) { + this.circle.setColor(notation.pop()); + canvas.drawCircle((x*this.getWidth()/11+(this.getWidth()*4/5)),(y*this.getHeight()/14+getHeight()/21), this.getWidth()/26, this.circle); + } + } + //TODO: ajout des boutons //Test de bouton valider this.circle.setColor(this.getResources().getColor(R.color.green)); canvas.drawCircle((this.getWidth()/2),this.getHeight()-this.getHeight()/16, this.getWidth()/13, this.circle); // bouton retour - /* this.circle.setColor(this.getResources().getColor(R.color.blue)); + /*this.circle.setColor(this.getResources().getColor(R.color.blue)); canvas.drawCircle((this.getWidth()/2), this.getHeight()-this.getHeight()/16, this.getWidth()/13, this.circle);*/ }