Fix: checkstyle

This commit is contained in:
Julian Kropff
2026-04-11 08:33:02 +02:00
parent f6dda36c8d
commit 2e705185f4
@@ -5,7 +5,6 @@ import ch.unibas.dmi.dbis.cs108.casono.client.game.GameService;
import ch.unibas.dmi.dbis.cs108.casono.client.game.GameState;
import ch.unibas.dmi.dbis.cs108.casono.client.game.Player;
import ch.unibas.dmi.dbis.cs108.casono.client.game.PlayerId;
import ch.unibas.dmi.dbis.cs108.casono.client.game.PlayerState;
import ch.unibas.dmi.dbis.cs108.casono.client.ui.gameui.gameuicomponents.PlayerStatusController;
import ch.unibas.dmi.dbis.cs108.casono.client.ui.gameui.gameuicomponents.TaskbarController;
import java.util.List;
@@ -169,94 +168,102 @@ public class CasinoGameController {
casinoTableInnerBox.setTranslateY(-screenHeight * TABLE_OFFSET_Y_FACTOR);
playerCardsBox.setTranslateY(screenHeight * PLAYER_CARDS_OFFSET_Y_FACTOR);
uiTest();
// uiTest();
// empty display only (optional)
renderCommunityCards(List.of());
renderPlayerCards(List.of());
}
/**
* Test method to demonstrate the UI functionality with sample data.
*/
@FXML
public void uiTest() {
if (communityCardsBox == null) {
LOGGER.info("communityCardsBox is NULL");
return;
}
try {
renderCommunityCards(
List.of(
new Card("ace", "hearts"),
new Card("king", "spades"),
new Card("10", "diamonds")));
renderPlayerCards(List.of(new Card("10", "spades"), new Card("king", "spades")));
} catch (Exception e) {
e.printStackTrace();
}
Player mathis = new Player(PlayerId.of("Mathis"), 20000);
mathis.setState(PlayerState.ACTIVE);
Player jona = new Player(PlayerId.of("Jona"), 20000);
jona.setState(PlayerState.FOLDED);
Player lars = new Player(PlayerId.of("Lars"), 20000);
lars.setState(PlayerState.ACTIVE);
player1Controller.setPlayer(mathis);
player2Controller.setPlayer(jona);
player3Controller.setPlayer(lars);
LOGGER.info(
"Player 1: "
+ mathis.getName()
+ " | $"
+ mathis.getChips()
+ " | "
+ mathis.getState());
LOGGER.info(
"Player 2: " + jona.getName() + " | $" + jona.getChips() + " | " + jona.getState());
LOGGER.info(
"Player 3: " + lars.getName() + " | $" + lars.getChips() + " | " + lars.getState());
if (playerStatusController != null) {
playerStatusController.setPlayer(mathis);
} else {
LOGGER.warning("PlayerStatusController is NULL");
}
javafx.stage.Screen screen = javafx.stage.Screen.getPrimary();
double screenHeight = screen.getBounds().getHeight();
casinoTableInnerBox.setTranslateY(-screenHeight * 0.08);
playerCardsBox.setTranslateY(screenHeight * 0.35);
renderPot(500);
lars.removeChips(500);
LOGGER.info("Lars: $" + lars.getChips());
player3Controller.refresh();
mathis.fall();
player1Controller.refresh();
GameState s = new GameState();
s.dealer = 3;
highlightDealer(s);
s.phase = "FLOP";
updateGameInfo(s);
s.winnerIndex = 1;
updateGameInfo(s);
}
// Test method to demonstrate the UI functionality with sample data.
// @FXML
// public void uiTest() {
// if (communityCardsBox == null) {
// LOGGER.info("communityCardsBox is NULL");
// return;
// }
//
// try {
// renderCommunityCards(
// List.of(
// new Card("ace", "hearts"),
// new Card("king", "spades"),
// new Card("10", "diamonds")));
//
// renderPlayerCards(List.of(new Card("10", "spades"), new Card("king", "spades")));
// } catch (Exception e) {
// e.printStackTrace();
// }
//
// Player mathis = new Player(PlayerId.of("Mathis"), 20000);
// mathis.setState(PlayerState.ACTIVE);
//
// Player jona = new Player(PlayerId.of("Jona"), 20000);
// jona.setState(PlayerState.FOLDED);
//
// Player lars = new Player(PlayerId.of("Lars"), 20000);
// lars.setState(PlayerState.ACTIVE);
//
// player1Controller.setPlayer(mathis);
// player2Controller.setPlayer(jona);
// player3Controller.setPlayer(lars);
//
// LOGGER.info(
// "Player 1: "
// + mathis.getName()
// + " | $"
// + mathis.getChips()
// + " | "
// + mathis.getState());
// LOGGER.info(
// "Player 2: "
// + jona.getName()
// + " | $"
// + jona.getChips()
// + " | "
// + jona.getState());
// LOGGER.info(
// "Player 3: "
// + lars.getName()
// + " | $"
// + lars.getChips()
// + " | "
// + lars.getState());
//
// if (playerStatusController != null) {
// playerStatusController.setPlayer(mathis);
// } else {
// LOGGER.warning("PlayerStatusController is NULL");
// }
//
// javafx.stage.Screen screen = javafx.stage.Screen.getPrimary();
// double screenHeight = screen.getBounds().getHeight();
//
// casinoTableInnerBox.setTranslateY(-screenHeight * 0.08);
// playerCardsBox.setTranslateY(screenHeight * 0.35);
//
// renderPot(500);
//
// lars.removeChips(500);
// LOGGER.info("Lars: $" + lars.getChips());
//
// player3Controller.refresh();
//
// mathis.fall();
// player1Controller.refresh();
//
// GameState s = new GameState();
// s.dealer = 3;
// highlightDealer(s);
//
// s.phase = "FLOP";
//
// updateGameInfo(s);
//
// s.winnerIndex = 1;
//
// updateGameInfo(s);
// }
/**
* Start the UI update loop.