Compare commits

..

No commits in common. "5143e21ba69e7c0c6527498f5bfe32296a7391c2" and "350c157493dc74655dd4499b1f47a76adcd18dca" have entirely different histories.

2 changed files with 10 additions and 5 deletions

View File

@ -80,7 +80,7 @@ public class ConfirmTrade extends Dialog {
// Ablehnen-Button // Ablehnen-Button
Button declineButton = confirmTradeContainer.addChild(new Button("Ablehnen", new ElementId("button"))); Button declineButton = confirmTradeContainer.addChild(new Button("Ablehnen", new ElementId("button")));
declineButton.setFontSize(32); declineButton.setFontSize(32);
declineButton.addClickCommands(s -> ifTopDialog(() -> { declineButton.addClickCommands(s -> ifTopDialog(() -> { //TODO Buttonfunktion prüfen
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
app.getGameLogic().send(new TradeResponse(false, tradeHandler)); app.getGameLogic().send(new TradeResponse(false, tradeHandler));
close(); close();
@ -91,9 +91,7 @@ public class ConfirmTrade extends Dialog {
negotiateButton.addClickCommands(s -> ifTopDialog( () -> { negotiateButton.addClickCommands(s -> ifTopDialog( () -> {
app.getGameLogic().playSound(Sound.BUTTON); app.getGameLogic().playSound(Sound.BUTTON);
close(); close();
TradeHandler t = new TradeHandler(app.getGameLogic().getPlayerHandler().getPlayerById(tradeHandler.getSender().getId())); new TradeMenu(app, new TradeHandler(app.getGameLogic().getPlayerHandler().getPlayerById(app.getId()))).open();
t.setReceiver(app.getGameLogic().getPlayerHandler().getPlayerById(tradeHandler.getReceiver().getId()));
new TradeMenu(app, t).open();
})); }));
// Confirm-Button // Confirm-Button
Button confirmButton = confirmTradeContainer.addChild(new Button("Bestätigen", new ElementId("button"))); Button confirmButton = confirmTradeContainer.addChild(new Button("Bestätigen", new ElementId("button")));

View File

@ -55,7 +55,14 @@ public class TradeHandler {
/** /**
* Constructs a TradeHandler for a single trade instance. * Constructs a TradeHandler for a single trade instance.
* *
* @param sender the Player initiating the trade * @param sender the Player initiating the trade
* @param receiver the Player receiving the trade offer
* @param offeredAmount the amount of money offered by the sender
* @param offeredProperties the properties offered by the sender
* @param offeredJailCards the jail cards offered by the sender
* @param requestedAmount the amount of money requested from the receiver
* @param requestedProperties the properties requested from the receiver
* @param requestedJailCards the jail cards requested from the receiver
*/ */
public TradeHandler(Player sender) { public TradeHandler(Player sender) {
this.sender = sender; this.sender = sender;