bugfix in Rack and LaticeApplicationWindow

master
Mathis 2022-05-03 17:18:03 +02:00
parent 122756df94
commit b8bf1ab8a8
2 changed files with 14 additions and 22 deletions

View File

@ -35,17 +35,30 @@ import latice.model.Tile;
public class LaticeApplicationWindow extends Application{ public class LaticeApplicationWindow extends Application{
javafx.scene.paint.Color realColor = new javafx.scene.paint.Color(0, 0, 0, 0);
Image image = new Image("laticePlateau.png"); Image image = new Image("laticePlateau.png");
ImageView imageView = new ImageView(image); ImageView imageView = new ImageView(image);
Tile blueBird = new Tile(Color.NAVYBLUE, Shape.BIRD); Tile blueBird = new Tile(Color.NAVYBLUE, Shape.BIRD);
Tile greenLeaf = new Tile(Color.GREEN, Shape.FEATHER); Tile greenLeaf = new Tile(Color.GREEN, Shape.FEATHER);
Tile redFlower = new Tile(Color.RED, Shape.FLOWER); Tile redFlower = new Tile(Color.RED, Shape.FLOWER);
public static void main(String[] args) { public static void main(String[] args) {
Application.launch(args); Application.launch(args);
} }
@Override @Override
public void start(Stage primaryStage) throws Exception { public void start(Stage primaryStage) throws Exception {
@ -81,21 +94,7 @@ public class LaticeApplicationWindow extends Application{
root.setCenter(pane); root.setCenter(pane);
//--------------------------------------------------------------------------------------
//Deck
ArrayList<Tile> listOfTile = new ArrayList<Tile>();
for (Color color : Color.values()) {
for (Shape shape : Shape.values()) {
Tile tile = new Tile(color, shape);
System.out.println(color.getStringColor() + shape.getStringShape()+ ".png");
listOfTile.add(tile);
}
}
Deck deck = new Deck(listOfTile);
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------

View File

@ -43,13 +43,6 @@ public class Rack {
public void setListRackTile(ArrayList<Tile> listRackTile) { public void setListRackTile(ArrayList<Tile> listRackTile) {
this.listRackTile = listRackTile; this.listRackTile = listRackTile;
} }
public ArrayList<Tile> getListRackTile() {
return listRackTile;
}
@ -66,7 +59,7 @@ public class Rack {
tile = (this.getListRackTile()).get(index); tile = (this.getListRackTile()).get(index);
image = new Image(tile.getShape().getStringShape() + " " + tile.getColor().getStringColor()+ ".png"); image = new Image(tile.getShape().getStringShape() + "_" + tile.getColor().getStringColor()+ ".png");
imageView = new ImageView(image); imageView = new ImageView(image);
rack.getChildren().add(imageView); rack.getChildren().add(imageView);