UPDATE Tile and LaticeApplicationConsole classes

master
mathi 2022-04-19 23:19:52 +02:00
parent 837651d0c6
commit dba464f4ef
2 changed files with 40 additions and 2 deletions

View File

@ -1,8 +1,38 @@
package latice.application; package latice.application;
import java.util.ArrayList;
import latice.model.Color;
import latice.model.Deck;
import latice.model.Shape;
import latice.model.Tile;
public class LaticeApplicationConsole { public class LaticeApplicationConsole {
public static void main(String[] args) { public static void main(String[] args) {
ArrayList<Tile> listOfTile = new ArrayList<Tile>();
System.out.println("Hello Latice !"); System.out.println("Hello Latice !");
for (Color color : Color.values()) {
for (Shape shape : Shape.values()) {
Tile tile = new Tile(color, shape);
System.out.println("tuile : couleur = " + tile.getColor() + " forme = " + tile.getShape());
listOfTile.add(tile);
}
}
System.out.println("Notre Deck :");
Deck deck = new Deck(listOfTile);
deck.getListTile();
System.out.println("-----------------");
} }
} }

View File

@ -1,11 +1,19 @@
package latice.model; package latice.model;
public class Tile { public class Tile {
Color color; private final Color color;
Shape shape; private final Shape shape;
public Tile(Color color, Shape shape) { public Tile(Color color, Shape shape) {
this.color = color; this.color = color;
this.shape = shape; this.shape = shape;
} }
public Color getColor() {
return this.color;
}
public Shape getShape() {
return this.shape;
}
} }