diff --git a/src/main/java/latice/model/GameBoard.java b/src/main/java/latice/model/GameBoard.java index 92d0161..9da6f67 100644 --- a/src/main/java/latice/model/GameBoard.java +++ b/src/main/java/latice/model/GameBoard.java @@ -2,8 +2,8 @@ package latice.model; public class GameBoard { private Integer DIMENSION = 9; - private final String SUN = " SU "; - private final String MOON = " MO "; + public static final String SUN = " SU "; + public static final String MOON = " MO "; private String[][] gridBoard; public GameBoard() { diff --git a/src/main/java/latice/model/Player.java b/src/main/java/latice/model/Player.java index 60d7441..11dfacd 100644 --- a/src/main/java/latice/model/Player.java +++ b/src/main/java/latice/model/Player.java @@ -30,6 +30,15 @@ public class Player { public void Play(Scanner play, GameBoard board) { System.out.println("c'est à votre tour de jouer " + this.name +"!"); + if (this.getScore() == 0) { + + System.out.println("Vous avez " + this.getScore() + " point"); + + }else { + System.out.println("Vous avez " + this.getScore() + " points"); + + } + System.out.print("Quel tuile voulez-vous jouez ? "); this.rack.displayRack(); String tileToPlay = play.next(); @@ -42,7 +51,7 @@ public class Player { board.displayGameBoard(); - this.rack.updateRack(deck); + this.rack.updateRack(); } diff --git a/src/main/java/latice/model/Rack.java b/src/main/java/latice/model/Rack.java index 3063828..02dd78f 100644 --- a/src/main/java/latice/model/Rack.java +++ b/src/main/java/latice/model/Rack.java @@ -12,19 +12,22 @@ import javafx.scene.text.Text; public class Rack { private ArrayList listRackTile = new ArrayList(); private ArrayList rackTileImage = new ArrayList(); + private Deck deck; public Rack(Deck deck) { + this.deck = deck; Tile tile; System.out.println("Il y a dans le rack : " + listRackTile.size() + " valeurs"); for (int i = 0; i < 5; i++) { - int index = (int)(Math.random()*(((deck.getListTile()).size()-1)-0+1)+0); //(int)(Math.random()*(max-min+1)+min); + int index = (int)(Math.random()*(((this.deck.getListTile()).size()-1)-0+1)+0); //(int)(Math.random()*(max-min+1)+min); - tile = (deck.getListTile()).get(index); + tile = (this.deck.getListTile()).get(index); this.listRackTile.add(tile); - deck.getListTile().remove(index); + this.deck.getListTile().remove(index); + @@ -45,17 +48,17 @@ public class Rack { } - public void updateRack(Deck deck) { + public void updateRack() { Tile tile; for (int i = 0; i < 5-this.listRackTile.size() ; i++) { - int index = (int)(Math.random()*( ((deck.getListTile()).size()-1)-0+1)+0); //(int)(Math.random()*(max-min+1)+min); + int index = (int)(Math.random()*( ((this.deck.getListTile()).size()-1)-0+1)+0); //(int)(Math.random()*(max-min+1)+min); - tile = (deck.getListTile()).get(index); + tile = (this.deck.getListTile()).get(index); this.listRackTile.add(tile); - deck.getListTile().remove(index); - + this.deck.getListTile().remove(index); + } }