diff --git a/src/main/java/latice/model/Deck.java b/src/main/java/latice/model/Deck.java new file mode 100644 index 0000000..df59de1 --- /dev/null +++ b/src/main/java/latice/model/Deck.java @@ -0,0 +1,20 @@ +package latice.model; + +import java.util.ArrayList; + +public class Deck { + private ArrayList deckTile = new ArrayList(); + + public Deck(ArrayList deckTile) { + this.deckTile = deckTile; + } + + public void getListTile() { + for (Tile tile : deckTile) { + System.out.println("tuile : couleur = " + tile.getColor() + " forme = " + tile.getShape()); + } + + } + + +} diff --git a/src/main/java/latice/model/Rack.java b/src/main/java/latice/model/Rack.java new file mode 100644 index 0000000..f4af62f --- /dev/null +++ b/src/main/java/latice/model/Rack.java @@ -0,0 +1,21 @@ +package latice.model; + +import java.util.ArrayList; + +public class Rack { + private ArrayList listRackTile = new ArrayList(); + + public Rack(ArrayList deck) { + for (int i = 0; i < 5; i++) { + int index = (int)(Math.random()*(deck.size()-0+1)+0); + listRackTile.add(deck.get(index)); + System.out.println("l'indice de la tuile ajouté au rack est : " + index + " qui est la tuile " + deck.get(index)); + + } + + + } +} + + +//(int)(Math.random()*(max-min+1)+min); \ No newline at end of file