start game stuff - both online and offline #13

Merged
lgc merged 24 commits from start-game into main 2024-12-13 16:27:43 +00:00
2 changed files with 19 additions and 6 deletions
Showing only changes of commit f151a89ea4 - Show all commits

View File

@ -1,4 +1,4 @@
import javafx.scene.control.ToggleGroup;
//import javafx.scene.control.ToggleGroup;
import javax.swing.*;
import java.awt.*;

View File

@ -2,6 +2,8 @@ import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.InetSocketAddress;
/*
TODO: evtl an Lucas: die "JoinGame" muss noch informationen erhalten, welche Spieler erstellt wurden und welches Semester
@ -60,19 +62,30 @@ public class JoinGame extends JPanel {
backButton.addActionListener(e -> frame.showPanel("MultiplayerGame"));
losButton.addActionListener(e -> frame.showPanel("Verbinden"));
/*
losButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String ipAddress = ipTextField.getText();
String portText = portTextField.getText();
int port = Integer.parseInt(portText);
InetSocketAddress address = new InetSocketAddress(ipAddress, port);
frame.showPanel("Verbinden");
//public static void startOnlineGame(Class<? extends LocalPlayer> localPlayerClass, String localPlayerName, InetSocketAddress
// address, int size) throws IOException {
if(playerType == 1) { //Beispiel (für playertape wäre z.B. 1 humanPlayer etc.)
GameController.startOnlineGame(HumanPlayer.class, playerName, adress); //
if(true) { //Beispiel (für playertape wäre z.B. 1 humanPlayer etc.)
try {
GameController.startOnlineGame(HumanPlayer.class, "TollerTest", address,GameController.semesterToBoardSize(2)); //
} catch (IOException ex) {
throw new RuntimeException(ex);
}
}
}
});
*/
}
}