From 1f3b07709c3b9beb57c7f3c8896ae306fc8e4892 Mon Sep 17 00:00:00 2001 From: Hanno Fleischer Date: Thu, 12 Dec 2024 00:20:15 +0100 Subject: [PATCH] added java docs to NoPieceState --- .../automaton/game/turn/choosepiece/NoPieceState.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java index 59fe977f..6cb13703 100644 --- a/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java +++ b/Projekte/mdga/model/src/main/java/pp/mdga/server/automaton/game/turn/choosepiece/NoPieceState.java @@ -24,6 +24,10 @@ public NoPieceState(ChoosePieceState choosePieceAutomaton, ServerGameLogic logic super(choosePieceAutomaton, logic); } + /** + * Initializes the state based on the current game logic and active player. + * Determines the next state of the automaton based on the game conditions. + */ private void initialize() { Player activePlayer = logic.getGame().getPlayerByColor(logic.getGame().getActiveColor()); if (logic.getGame().getDiceModifier() == 0) { @@ -53,6 +57,12 @@ private void initialize() { } } + /** + * Checks and selects the pieces that can be moved by the active player. + * Updates the state of the automaton based on the movable pieces. + * + * @param activePlayer the player whose pieces are being checked + */ private void checkSelectPiece(Player activePlayer) { ArrayList moveablePieces = new ArrayList<>(); for (Piece piece : activePlayer.getPieces()) {