Merge branch 'chore/42-translate-multiple-client-components-to-english' into 'main'
Chore/42 translate multiple client components to english Closes #42 See merge request cs108-fs26/Gruppe-13!69
This commit was merged in pull request #225.
This commit is contained in:
@@ -10,15 +10,15 @@ import org.apache.logging.log4j.Logger;
|
||||
/**
|
||||
* Entry point for the Casono client application. Handles client startup and connection parameters.
|
||||
*
|
||||
* <p>Standardkonstruktor für die Anwendung.
|
||||
* <p>Default constructor for the application.
|
||||
*/
|
||||
public class ClientApp {
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(ClientApp.class);
|
||||
|
||||
/** Standardkonstruktor. */
|
||||
/** Default constructor. */
|
||||
public ClientApp() {
|
||||
// Standardkonstruktor
|
||||
// Default constructor
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,13 +6,13 @@ import javafx.application.Application;
|
||||
/**
|
||||
* Launcher for the Casono main UI.
|
||||
*
|
||||
* <p>Standardkonstruktor für die Anwendung.
|
||||
* <p>Default constructor for the application.
|
||||
*/
|
||||
public class Launcher {
|
||||
|
||||
/** Standardkonstruktor. */
|
||||
/** Default constructor. */
|
||||
public Launcher() {
|
||||
// Standardkonstruktor
|
||||
// Default constructor
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,13 +10,13 @@ import javafx.stage.Stage;
|
||||
/**
|
||||
* JavaFX Application class for the Casono main UI.
|
||||
*
|
||||
* <p>Standardkonstruktor für die Anwendung.
|
||||
* <p>Default constructor for the application.
|
||||
*/
|
||||
public class Casinomainui extends Application {
|
||||
|
||||
/** Standardkonstruktor. */
|
||||
/** Default constructor. */
|
||||
public Casinomainui() {
|
||||
// Standardkonstruktor
|
||||
// Default constructor
|
||||
}
|
||||
|
||||
private static final int SCENE_WIDTH = 1200;
|
||||
|
||||
+2
-2
@@ -58,7 +58,7 @@ public class CasinomainuiController {
|
||||
@FXML
|
||||
public void handleCreateLobbyButton() {
|
||||
if (translationManager.isFull()) {
|
||||
LOGGER.warn("Grid voll! Keine weiteren Lobbys moeglich.");
|
||||
LOGGER.warn("Grid is full! No more lobbies available.");
|
||||
return;
|
||||
}
|
||||
int buttonId = nextButtonId++;
|
||||
@@ -68,7 +68,7 @@ public class CasinomainuiController {
|
||||
LOGGER.info("ButtonID: {}, LobbyID: {}", buttonId, lobbyId);
|
||||
gridManager.renderLobbyButtons();
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Fehler beim Hinzufügen: {}", e.getMessage());
|
||||
LOGGER.error("Error while adding lobby button: {}", e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
-23
@@ -4,19 +4,19 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Verwaltet das Mapping zwischen Button-IDs und Lobby-IDs rein im Speicher. Keine Dateioperationen,
|
||||
* nur Laufzeitdatenstruktur.
|
||||
* Manages the mapping between Button IDs and Lobby IDs in memory only. No file operations,
|
||||
* runtime-only data structure.
|
||||
*/
|
||||
public class LobbyButtonTranslationManager {
|
||||
|
||||
// Singleton-Instanz
|
||||
// Singleton instance
|
||||
private static LobbyButtonTranslationManager instance;
|
||||
|
||||
// Singleton-Zugriff
|
||||
// Singleton access
|
||||
/**
|
||||
* Liefert die Singleton-Instanz des Managers.
|
||||
* Returns the singleton instance of the manager.
|
||||
*
|
||||
* @return die einzige Instanz von {@code LobbyButtonTranslationManager}
|
||||
* @return the single instance of {@code LobbyButtonTranslationManager}
|
||||
*/
|
||||
public static LobbyButtonTranslationManager getInstance() {
|
||||
if (instance == null) {
|
||||
@@ -25,32 +25,32 @@ public class LobbyButtonTranslationManager {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/** Maximale Anzahl an Buttons/Lobbys */
|
||||
/** Maximum number of buttons/lobbies */
|
||||
private static final int MAX_BUTTONS = 8;
|
||||
|
||||
/** Zuordnung ButtonID → LobbyID */
|
||||
/** Mapping ButtonID → LobbyID */
|
||||
private final Map<Integer, Integer> buttonIdToLobbyId = new HashMap<>();
|
||||
|
||||
/** Privater Konstruktor für Singleton-Pattern */
|
||||
/** Private constructor for the singleton pattern */
|
||||
private LobbyButtonTranslationManager() {
|
||||
// Zuordnung bleibt leer beim Start
|
||||
// Mapping is empty at startup
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft, ob das Grid voll ist (MAX_BUTTONS erreicht).
|
||||
* Checks whether the grid is full (MAX_BUTTONS reached).
|
||||
*
|
||||
* @return true, wenn Grid voll; sonst false
|
||||
* @return true if the grid is full; otherwise false
|
||||
*/
|
||||
public boolean isFull() {
|
||||
return buttonIdToLobbyId.size() >= MAX_BUTTONS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fügt eine Zuordnung ButtonID → LobbyID hinzu.
|
||||
* Adds a mapping ButtonID → LobbyID.
|
||||
*
|
||||
* @param buttonId Die ID des Buttons
|
||||
* @param lobbyId Die ID der Lobby
|
||||
* @throws Exception wenn das Grid voll ist
|
||||
* @param buttonId the ID of the button
|
||||
* @param lobbyId the ID of the lobby
|
||||
* @throws Exception when the grid is full
|
||||
*/
|
||||
public void addLobbyButton(int buttonId, int lobbyId) throws Exception {
|
||||
if (isFull()) {
|
||||
@@ -60,28 +60,28 @@ public class LobbyButtonTranslationManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Entfernt eine Zuordnung für die gegebene ButtonID.
|
||||
* Removes the mapping for the given ButtonID.
|
||||
*
|
||||
* @param buttonId Die ID des zu entfernenden Buttons
|
||||
* @param buttonId the ID of the button to remove
|
||||
*/
|
||||
public void removeLobbyButton(int buttonId) {
|
||||
buttonIdToLobbyId.remove(buttonId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt die LobbyID für eine gegebene ButtonID zurück.
|
||||
* Returns the LobbyID for a given ButtonID.
|
||||
*
|
||||
* @param buttonId Die ButtonID
|
||||
* @return Die zugehoerige LobbyID oder null, falls nicht vorhanden
|
||||
* @param buttonId the ButtonID
|
||||
* @return the associated LobbyID or null if not present
|
||||
*/
|
||||
public Integer getLobbyIdForButton(int buttonId) {
|
||||
return buttonIdToLobbyId.get(buttonId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt die gesamte Zuordnung ButtonID → LobbyID zurück.
|
||||
* Returns the full mapping ButtonID → LobbyID.
|
||||
*
|
||||
* @return Map aller Zuordnungen
|
||||
* @return Map of all mappings
|
||||
*/
|
||||
public Map<Integer, Integer> getButtonIdToLobbyId() {
|
||||
return buttonIdToLobbyId;
|
||||
|
||||
Reference in New Issue
Block a user