Fixed: MARKED TODO JAVADOC

This commit is contained in:
rubenpirreram
2026-06-14 17:08:34 +02:00
parent 4c2290a1c5
commit 8f92cb1594
8 changed files with 80 additions and 33 deletions
@@ -19,7 +19,7 @@ import java.util.List;
* during totem selection may free a totem for other players. * during totem selection may free a totem for other players.
*/ */
public class DisconnectedPlayer extends NetworkEvent { public class DisconnectedPlayer extends NetworkEvent {
//TODO
private List<Totems> availableTotems; private List<Totems> availableTotems;
@@ -11,14 +11,7 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
/** //TODO ALL JAVADOC
* Ambient fire particle system for the main game scene.
*
* <p>Spawns embers, sparks, and dust from the four screen corners and animates
* them toward the center using an {@link AnimationTimer} capped at 30 fps.
* Add the pane returned by {@link #getPane()} to the scene root, then call
* {@link #start()} to begin the animation.
*/
public class FireParticleSystem { public class FireParticleSystem {
private static final int MAX_PARTICLES = 30; private static final int MAX_PARTICLES = 30;
@@ -33,29 +33,43 @@ import static it.polimi.ingsw.gc14.Model.GamePackage.GameStages.TOTEM_CHOICE;
* main game, and leaderboard scenes based on the current game state. * main game, and leaderboard scenes based on the current game state.
*/ */
public class GUI extends Application implements IView { public class GUI extends Application implements IView {
//TODO
private Stage primaryStage; private Stage primaryStage;
//TODO
private volatile MiniModel miniModel; private volatile MiniModel miniModel;
//TODO
private FXMLLoader loaderLogin; private FXMLLoader loaderLogin;
//TODO
private Scene loginScene; private Scene loginScene;
//TODO
private LoginFXMLController controllerLogin; private LoginFXMLController controllerLogin;
//TODO
private FXMLLoader loaderTotem; private FXMLLoader loaderTotem;
//TODO
private Scene totemScene; private Scene totemScene;
//TODO
private TotemFXMLController controllerTotem; private TotemFXMLController controllerTotem;
//TODO
private FXMLLoader loaderMain; private FXMLLoader loaderMain;
private Scene mainScene;
private MainFXMLController controllerMain;
//TODO
private Scene mainScene;
//TODO
private MainFXMLController controllerMain;
//TODO
private FXMLLoader loaderLeaderboard; private FXMLLoader loaderLeaderboard;
//TODO
private Scene leaderboardScene; private Scene leaderboardScene;
//TODO
private LeaderboardFXMLController controllerLeaderboard; private LeaderboardFXMLController controllerLeaderboard;
//TODO
private ClientController controller; private ClientController controller;
//TODO
private boolean autoReenterFullscreen = true; private boolean autoReenterFullscreen = true;
//TODO
private boolean isFading = false; private boolean isFading = false;
//TODO
private MediaPlayer bgMusic; private MediaPlayer bgMusic;
@@ -194,12 +208,12 @@ public class GUI extends Application implements IView {
} }
}); });
} }
//TODO
private void wrapScene(Scene scene) { private void wrapScene(Scene scene) {
Parent root = scene.getRoot(); Parent root = scene.getRoot();
scene.setRoot(new StackPane(root)); scene.setRoot(new StackPane(root));
} }
//TODO
private void fadeToScene(Scene newScene) { private void fadeToScene(Scene newScene) {
Scene currentScene = primaryStage.getScene(); Scene currentScene = primaryStage.getScene();
if (currentScene == newScene || isFading) return; if (currentScene == newScene || isFading) return;
@@ -41,14 +41,18 @@ public class LeaderboardFXMLController {
@FXML private VBox mainVBox; @FXML private VBox mainVBox;
@FXML private VBox rankingList; @FXML private VBox rankingList;
// title label removed; outcome text is added dynamically in render() // title label removed; outcome text is added dynamically in render()
//TODO
private ClientController controller; private ClientController controller;
//TODO
private Popup popup; private Popup popup;
//TODO
private VBox popupContent; private VBox popupContent;
//TODO
private static final Map<String, Image> imageCache = new HashMap<>(); private static final Map<String, Image> imageCache = new HashMap<>();
//TODO
private Scene loginScene; private Scene loginScene;
//TODO
private Runnable action; private Runnable action;
/** Returns a cached {@link Image} for the given classpath {@code path}, loading it on first access. */ /** Returns a cached {@link Image} for the given classpath {@code path}, loading it on first access. */
@@ -29,22 +29,33 @@ import java.util.Enumeration;
* and initiates the connection to the server. * and initiates the connection to the server.
*/ */
public class LoginFXMLController { public class LoginFXMLController {
//TODO
@FXML private ImageView backgroundImage; @FXML private ImageView backgroundImage;
//TODO
@FXML private TextField campoNome; @FXML private TextField campoNome;
//TODO
@FXML private TextField campoNumPlayers; @FXML private TextField campoNumPlayers;
//TODO
@FXML private TextField campoIP; @FXML private TextField campoIP;
//TODO
@FXML private Button btnAccedi; @FXML private Button btnAccedi;
//TODO
@FXML private Label labelErrore; @FXML private Label labelErrore;
//TODO
@FXML private VBox formPanel; @FXML private VBox formPanel;
//TODO
@FXML private StackPane protocolToggle; @FXML private StackPane protocolToggle;
//TODO
@FXML private Region toggleThumb; @FXML private Region toggleThumb;
//TODO
@FXML private Label labelRMI; @FXML private Label labelRMI;
//TODO
@FXML private Label labelTCP; @FXML private Label labelTCP;
//TODO
private boolean isRMI = true; private boolean isRMI = true;
//TODO
private ClientController controller; private ClientController controller;
//TODO
private final PseudoClass activeProtocolPseudo = PseudoClass.getPseudoClass("active-protocol"); private final PseudoClass activeProtocolPseudo = PseudoClass.getPseudoClass("active-protocol");
/** /**
@@ -46,26 +46,41 @@ import java.util.*;
* the player's hand, and action buttons (skip, details). * the player's hand, and action buttons (skip, details).
*/ */
public class MainFXMLController { public class MainFXMLController {
//TODO
@FXML private GridPane leftGrid; @FXML private GridPane leftGrid;
//TODO
@FXML private ScrollPane playerSide; @FXML private ScrollPane playerSide;
//TODO
@FXML private HBox mainHBox; @FXML private HBox mainHBox;
//TODO
@FXML private ImageView backgroundImage; @FXML private ImageView backgroundImage;
//TODO
@FXML private HBox board; @FXML private HBox board;
//TODO
@FXML private HBox upperList; @FXML private HBox upperList;
//TODO
@FXML private HBox lowerList; @FXML private HBox lowerList;
//TODO
@FXML private HBox myHand; @FXML private HBox myHand;
//TODO
@FXML private Button skipBtn; @FXML private Button skipBtn;
//TODO
@FXML private Button detailsBtn; @FXML private Button detailsBtn;
//TODO
@FXML private Label infoText; @FXML private Label infoText;
//TODO
private final Map<String, Label> foodLabels = new HashMap<>(); private final Map<String, Label> foodLabels = new HashMap<>();
//TODO
private final Map<String, Label> prestigeLabels = new HashMap<>(); private final Map<String, Label> prestigeLabels = new HashMap<>();
//TODO
private final Map<String, VBox> playerCards = new HashMap<>(); private final Map<String, VBox> playerCards = new HashMap<>();
//TODO
private final Map<String, List<ImageView>> iconViews = new HashMap<>(); private final Map<String, List<ImageView>> iconViews = new HashMap<>();
//TODO
private Popup popup; private Popup popup;
//TODO
private HBox popupCards; private HBox popupCards;
//TODO
private ClientController controller; private ClientController controller;
/** {@code true} when the last received event was an error response. */ /** {@code true} when the last received event was an error response. */
@@ -24,14 +24,20 @@ import java.util.Locale;
* other players see a waiting banner. * other players see a waiting banner.
*/ */
public class TotemFXMLController { public class TotemFXMLController {
//TODO
@FXML private ImageView backgroundImage; @FXML private ImageView backgroundImage;
//TODO
@FXML private HBox mainHBox; @FXML private HBox mainHBox;
//TODO
@FXML private Label turnBanner; @FXML private Label turnBanner;
//TODO
@FXML private Button confirmButton; @FXML private Button confirmButton;
//TODO
private ClientController controller; private ClientController controller;
//TODO
private int selectedIndex = -1; private int selectedIndex = -1;
//TODO
private StackPane selectedFrame = null; private StackPane selectedFrame = null;
/** /**
@@ -21,24 +21,28 @@ import java.util.*;
* }</pre> * }</pre>
*/ */
public class AsciiTable { public class AsciiTable {
//TODO
private final BorderStyle s; private final BorderStyle s;
//TODO
private final int cols; private final int cols;
//TODO
private final List<List<String>> rows = new ArrayList<>(); private final List<List<String>> rows = new ArrayList<>();
//TODO
private final List<Integer> separators = new ArrayList<>(); private final List<Integer> separators = new ArrayList<>();
//TODO
public AsciiTable(BorderStyle s, int cols) { public AsciiTable(BorderStyle s, int cols) {
this.s = s; this.cols = cols; this.s = s; this.cols = cols;
} }
//TODO
public void addRow(String... cells) { rows.add(Arrays.asList(cells)); } public void addRow(String... cells) { rows.add(Arrays.asList(cells)); }
//TODO
public void addRow(List<String> cells) { rows.add(cells); } public void addRow(List<String> cells) { rows.add(cells); }
//TODO
public void addHeader(String... cells) { public void addHeader(String... cells) {
rows.add(0, Arrays.asList(cells)); rows.add(0, Arrays.asList(cells));
separators.add(0); separators.add(0);
} }
//TODO
public void addSeparator() { separators.add(rows.size() - 1); } public void addSeparator() { separators.add(rows.size() - 1); }
/** /**
@@ -63,7 +67,7 @@ public class AsciiTable {
sb.append(hline(s.bl(), s.mb(), s.br(), maxWidth)); sb.append(hline(s.bl(), s.mb(), s.br(), maxWidth));
return sb.toString(); return sb.toString();
} }
//TODO
private String hline(String l, String m, String r, int maxWidth) { private String hline(String l, String m, String r, int maxWidth) {
var sb = new StringBuilder(l); var sb = new StringBuilder(l);
for (int i = 0; i < cols; i++) { for (int i = 0; i < cols; i++) {