WIP add Deck and Rack classes
parent
dba464f4ef
commit
431e9759e9
|
@ -0,0 +1,20 @@
|
|||
package latice.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Deck {
|
||||
private ArrayList<Tile> deckTile = new ArrayList<Tile>();
|
||||
|
||||
public Deck(ArrayList<Tile> deckTile) {
|
||||
this.deckTile = deckTile;
|
||||
}
|
||||
|
||||
public void getListTile() {
|
||||
for (Tile tile : deckTile) {
|
||||
System.out.println("tuile : couleur = " + tile.getColor() + " forme = " + tile.getShape());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package latice.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Rack {
|
||||
private ArrayList<Tile> listRackTile = new ArrayList<Tile>();
|
||||
|
||||
public Rack(ArrayList<Tile> 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);
|
Loading…
Reference in New Issue