Skip to content

Commit

Permalink
Merge branch 'main' of github.com:davi-bart/OOP23-coloni-ces
Browse files Browse the repository at this point in the history
  • Loading branch information
andsam0 committed Feb 15, 2024
2 parents 31f763d + 182478e commit 98672b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/it/unibo/view/TradeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,18 @@ private void showTradeStage() {
tradeBank.setDisable(!enable);
};

reloadBankTradeButton.run();
Stream.of(ResourceType.values()).forEach(resource -> {
proposedResourcesBox.getChildren().add(resourceAndComboBox(resource,
controller.getPlayerResources(controller.getCurrentPlayer()).get(resource),
(options, oldValue, newValue) -> {
proposedResources.put(resource, newValue);
reloadBankTradeButton.run();
}));
wantedResourcesBox.getChildren()
.add(resourceAndComboBox(resource, defaultWantedResources, (options, oldValue, newValue) -> {
wantedResourcesBox.getChildren().add(resourceAndComboBox(resource,
defaultWantedResources, (options, oldValue, newValue) -> {
wantedResources.put(resource, newValue);
playerToButton.forEach((playerName, button) -> {
wantedResources.put(resource, newValue);
if (!controller.hasResources(playerName, wantedResources)) {
button.setDisable(true);
} else {
Expand Down

0 comments on commit 98672b8

Please sign in to comment.