-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
martin
committed
May 25, 2026
1 parent
69f7abe
commit 08991e1
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package millions.view; | ||
|
|
||
| import javafx.application.Platform; | ||
| import javafx.scene.control.Button; | ||
| import javafx.scene.control.Label; | ||
| import javafx.scene.layout.VBox; | ||
| import millions.model.Player; | ||
|
|
||
| public class ExitView extends VBox { | ||
|
|
||
| public ExitView(Player player) { | ||
| setSpacing(12); | ||
|
|
||
| Label title = new Label("Game over"); | ||
| Label weeks = new Label("Weeks traded: " + player.getTransactionArchive().countDistinctWeeks()); | ||
| Label trades = new Label("Trades: " + player.getTransactionArchive().getTransactions().size()); | ||
| Label netWorth = new Label("Final net worth: " + player.getNetWorth()); | ||
| Label netProfit = | ||
| new Label("Total profit: " + player.getNetWorth().subtract(player.getStartingMoneh())); | ||
|
|
||
| Button quitButton = new Button("Quit"); | ||
| quitButton.setOnAction(event -> Platform.exit()); | ||
|
|
||
| getChildren().addAll(title, weeks, trades, netWorth, quitButton, netProfit); | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters