Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Hossein-AliHosseini committed Jul 10, 2021
1 parent b6c1888 commit 4239780
Showing 1 changed file with 3 additions and 45 deletions.
48 changes: 3 additions & 45 deletions src/main/java/SceneController/GamePlayView.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ public class GamePlayView {
public Pane previousFirstPlayerSpellTrapPane;
public Pane previousSecondPlayerMonsterPane;
public Pane previousSecondPlayerSpellTrapPane;


public Pane previousFirstPlayerFieldZonePane;
public Pane previousSecondPlayerFieldZonePane;

Expand All @@ -86,18 +84,16 @@ public void initialize() throws Exception {
this.mainPane.getChildren().add(loadFirstPlayersSpellTrapCards());
if (loadFirstPlayersFieldZoneCard() != null)
this.mainPane.getChildren().add(loadFirstPlayersFieldZoneCard());
loadFirstPlayersGraveyard(firstPlayersGraveyard);
loadFirstPlayersCardsInHand(firstPlayersCardsInHand);
this.mainPane.getChildren().add(loadSecondPlayersMonsterCards());
this.mainPane.getChildren().add(loadSecondPlayersSpellTrapCards());
if (loadSecondPlayersFieldZoneCard() != null)
this.mainPane.getChildren().add(loadSecondPlayersFieldZoneCard());
loadSecondPlayersGraveyard(secondPlayersGraveyard);
loadSecondPlayersCardsInHand(secondPlayersCardsInHand);
loadProfiles(yourProfile, opponentProfile, yourUsername, opponentUsername, yourLP, opponentLP, yourNickname, opponentNickname, firstPlayersBoard, secondPlayersBoard);
}

public void gameEndCheck() throws Exception {
public void gameEndCheck() throws Exception {
if (firstPlayersBoard.getPlayer().getLP() <= 0 ||
secondPlayersBoard.getMainDeckCards().size() == 0) {
stage.close();
Expand Down Expand Up @@ -197,7 +193,6 @@ public Pane loadFirstPlayersFieldZoneCard() {
if (firstPlayersBoard.getFieldZone() == null) return null;
if (mainPane.getChildren().contains(previousFirstPlayerFieldZonePane))
mainPane.getChildren().remove(previousFirstPlayerFieldZonePane);
HBox hBox = new HBox();
Image image = new Image(getClass().getResource("/Assets/" + toCamelCase(firstPlayersBoard.getFieldZone().getName()) + ".jpg").toExternalForm());
ImageView imageView = new ImageView(image);
imageView.setFitWidth(67.2);
Expand All @@ -215,30 +210,13 @@ public void handle(MouseEvent mouseEvent) {
pane.setLayoutY(333);
pane.setPrefHeight(88);
pane.setPrefWidth(60);
pane.getChildren().add(hBox);
pane.getChildren().add(imageView);
previousFirstPlayerFieldZonePane = pane;
return pane;
}



public void loadFirstPlayersGraveyard(Pane pane) {
for (int i = 0 ; i < firstPlayersBoard.getGraveYard().size() ; i++) {
Image image = new Image(getClass().getResource("/Assets/" + toCamelCase(firstPlayersBoard.getGraveYard().get(i).getName()) + ".jpg").toExternalForm());
ImageView imageView = new ImageView(image);
imageView.setFitWidth(67.2);
imageView.setFitHeight(98);
imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent mouseEvent) {

}
});
pane.getChildren().add(0 ,imageView);
}
}



public void loadFirstPlayersCardsInHand(ScrollPane scrollPane) {
HBox hBox = new HBox();
Expand Down Expand Up @@ -341,7 +319,6 @@ public Pane loadSecondPlayersFieldZoneCard() {
if (secondPlayersBoard.getFieldZone() == null) return null;
if (mainPane.getChildren().contains(previousSecondPlayerFieldZonePane))
mainPane.getChildren().remove(previousSecondPlayerFieldZonePane);
HBox hBox = new HBox();
Image image = new Image(getClass().getResource("/Assets/" + toCamelCase(secondPlayersBoard.getFieldZone().getName()) + ".jpg").toExternalForm());
ImageView imageView = new ImageView(image);
imageView.setFitWidth(67.2);
Expand All @@ -359,33 +336,14 @@ public void handle(MouseEvent mouseEvent) {
pane.setLayoutY(172);
pane.setPrefHeight(88);
pane.setPrefWidth(60);
pane.getChildren().add(hBox);
pane.getChildren().add(imageView);
previousSecondPlayerFieldZonePane = pane;
return pane;
}




public void loadSecondPlayersGraveyard(Pane pane) {
for (int i = 0 ; i < secondPlayersBoard.getGraveYard().size() ; i++) {
Image image = new Image(getClass().getResource("/Assets/" + toCamelCase(secondPlayersBoard.getGraveYard().get(i).getName()) + ".jpg").toExternalForm());
ImageView imageView = new ImageView(image);
imageView.setFitWidth(67.2);
imageView.setFitHeight(98);
imageView.setOnMouseClicked(new EventHandler<MouseEvent>() {
@Override
public void handle(MouseEvent mouseEvent) {

}
});
pane.getChildren().add(0 ,imageView);
}
}




public void loadSecondPlayersCardsInHand(ScrollPane scrollPane) {
HBox hBox = new HBox();
for (int i = 0 ; i < secondPlayersBoard.getCardsInHand().size() ; i++) {
Expand Down

0 comments on commit 4239780

Please sign in to comment.