diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ChoosePartner.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ChoosePartner.java index 439740e..46acfdf 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ChoosePartner.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/ChoosePartner.java @@ -205,7 +205,6 @@ public class ChoosePartner extends Dialog { public void update(float tpf) { if (selectionRef.update()) { String selected = selectionRef.get().toString(); - System.out.println(selected); listener.onSelectionChanged(selected); } } @@ -235,7 +234,6 @@ public class ChoosePartner extends Dialog { * Callback for when the dropdown selection changes. */ private void onDropdownSelectionChanged(String selected) { - System.out.println("Selected: " + selected); app.getGameLogic().playSound(Sound.BUTTON); int idStart = selected.indexOf("(ID: ") + 5; // Find start of the ID int idEnd = selected.indexOf(")", idStart); // Find end of the ID @@ -247,9 +245,6 @@ public class ChoosePartner extends Dialog { if (selectedPlayer != null) { tradeHandler.setReceiver(selectedPlayer); // Set the receiver in TradeHandler - System.out.println("Receiver set to: " + selectedPlayer.getName() + " (ID: " + selectedPlayer.getId() + ")"); - } else { - System.err.println("Player with ID " + playerId + " not found."); } } diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java index e817671..720582f 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/LobbyMenu.java @@ -241,7 +241,6 @@ public class LobbyMenu extends Dialog { public void update(float tpf) { if (selectionRef.update()) { String selected = selectionRef.get().toString(); - System.out.println(selected); listener.onSelectionChanged(selected); } } @@ -270,7 +269,6 @@ public class LobbyMenu extends Dialog { * Callback for when the dropdown selection changes. */ private void onDropdownSelectionChanged(String selected) { - System.out.println("Selected: " + selected); app.getGameLogic().playSound(Sound.BUTTON); switch (selected) { case "[0]": diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java index 408dad1..81aa4ef 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/Toolbar.java @@ -223,7 +223,6 @@ public class Toolbar extends Dialog implements GameEventListener{ } } overviewContainer.setBackground(new QuadBackgroundComponent(new ColorRGBA(0.4657f, 0.4735f, 0.4892f, 1.0f))); - System.out.println("pdate"); } @@ -236,7 +235,6 @@ public class Toolbar extends Dialog implements GameEventListener{ icon2.setIconSize(new Vector2f(100, 100)); imageLabel.setIcon(icon1); imageLabel2.setIcon(icon2); - System.out.println("Dice images set"); } private String diceToString(int i) { diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java index b432191..7a7ecdf 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/client/ClientGameLogic.java @@ -146,7 +146,6 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker { LOGGER.log(Level.ERROR, "trying to send {0} with sender==null", msg); //NON-NLS } else { clientSender.send(msg); - System.out.println("Message gesendet"); } } @@ -216,7 +215,6 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker { @Override public void received(DiceResult msg) { playSound(Sound.DICE_ROLL); - System.out.println("Message kam an"); notifyListeners(new DiceRollEvent(msg.getRollResult().get(0), msg.getRollResult().get(1))); } @@ -344,7 +342,6 @@ public class ClientGameLogic implements ServerInterpreter, GameEventBroker { @Override public void received(NextPlayerTurn msg) { - System.out.println("Du bsit am zug message empfangen"); setState(new ActiveState(this)); } } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java index ac85ba2..4cb0323 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/Player.java @@ -395,7 +395,6 @@ public class Player implements FieldVisitor{ * @return the result of a dice roll (1 to 6) */ private static int rollDice() { - System.out.println("Gewuerfelt"); return random.nextInt(6) + 1; } } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java index dbb57fb..b1d4a56 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java @@ -156,7 +156,6 @@ public class PlayerHandler { public Player getPlayerById(int id) { for (Player player : players) { if (player.getId() == id) return player; - System.out.println(player.getId()); } throw new NoSuchElementException("Player mit id "+id+" existiert nicht"); } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java index 7e2c13e..1d1c7ce 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java @@ -132,7 +132,6 @@ public class ServerGameLogic implements ClientInterpreter { playerHandler.addPlayer(player); LOGGER.log(Level.DEBUG, "Player added: {0}", player.getId()); - System.out.println("Anzahl Spieler verbunden:"+ playerHandler.getPlayerCount()); return player; } @@ -221,7 +220,6 @@ public class ServerGameLogic implements ClientInterpreter { public void received(RollDice msg, int from) { Player player = playerHandler.getPlayerById(from); if (player != null) { - System.out.println("Ergebniss gesendet"); send(player, player.rollDice()); } } diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/TradeHandler.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/TradeHandler.java index 6e6a89e..fe0aa48 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/model/TradeHandler.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/model/TradeHandler.java @@ -104,10 +104,10 @@ public class TradeHandler { */ public boolean initiateTrade() { if (!validateTrade()) { - System.out.println("Trade offer is invalid."); + return false; } - System.out.println("Trade initiated by " + sender.getName() + " to " + receiver.getName()); + return true; } @@ -138,14 +138,14 @@ public class TradeHandler { transferJailCards(sender, receiver, offeredJailCards); transferJailCards(receiver, sender, requestedJailCards); - System.out.println("Trade completed between " + sender.getName() + " and " + receiver.getName()); + } /** * Rejects the trade. */ public void rejectTrade() { - System.out.println(receiver.getName() + " rejected the trade."); + } /** @@ -156,13 +156,13 @@ public class TradeHandler { private boolean validateTrade() { // Validate sender's ability to offer money if (sender.getAccountBalance() < offeredAmount) { - System.out.println("Sender does not have enough money to offer."); + return false; } // Validate receiver's ability to fulfill the requested amount if (receiver.getAccountBalance() < requestedAmount) { - System.out.println("Receiver does not have enough money to fulfill the request."); + return false; } @@ -170,7 +170,7 @@ public class TradeHandler { if (offeredProperties != null) { for (PropertyField property : offeredProperties) { if (!sender.getProperties().contains(property)) { - System.out.println("Sender does not own property: " + property.getName()); + return false; } } @@ -178,7 +178,7 @@ public class TradeHandler { if (requestedProperties != null) { for (PropertyField property : requestedProperties) { if (!receiver.getProperties().contains(property)) { - System.out.println("Receiver does not own property: " + property.getName()); + return false; } } @@ -186,11 +186,11 @@ public class TradeHandler { // Validate jail cards if (sender.getNumJailCard() < offeredJailCards) { - System.out.println("Sender does not have enough jail cards to offer."); + return false; } if (receiver.getNumJailCard() < requestedJailCards) { - System.out.println("Receiver does not have enough jail cards to fulfill the request."); + return false; } @@ -208,7 +208,7 @@ public class TradeHandler { from.sellProperty(property); to.buyProperty(property); property.setOwner(to); - System.out.println("Property " + property.getName() + " transferred from " + from.getName() + " to " + to.getName()); + } /** @@ -223,7 +223,7 @@ public class TradeHandler { from.removeJailCard(); to.addJailCard(); } - System.out.println(numCards + " jail card(s) transferred from " + from.getName() + " to " + to.getName()); + } public void setOfferedAmount(int offeredAmount) { diff --git a/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java b/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java index a79f960..92557bf 100644 --- a/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java +++ b/Projekte/monopoly/server/src/main/java/pp/monopoly/server/MonopolyServer.java @@ -147,7 +147,6 @@ public class MonopolyServer implements MessageListener, Connec @Override public void messageReceived(HostedConnection source, Message message) { - System.out.println("Message recieved"); LOGGER.log(Level.INFO, "message received from {0}: {1}", source.getId(), message); //NON-NLS if (message instanceof ClientMessage clientMessage) pendingMessages.add(new ReceivedMessage(clientMessage, source.getId())); @@ -157,7 +156,6 @@ public class MonopolyServer implements MessageListener, Connec public void connectionAdded(Server server, HostedConnection hostedConnection) { LOGGER.log(Level.INFO, "New connection established: {0}", hostedConnection); //NON-NLS logic.addPlayer(hostedConnection.getId()); - System.out.println("Spieler verbunden: ID = " + hostedConnection.getId()); } @Override