start game stuff - both online and offline #13
|
@ -1,4 +1,4 @@
|
|||
import javafx.scene.control.ToggleGroup;
|
||||
//import javafx.scene.control.ToggleGroup;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
|
|
@ -2,12 +2,14 @@ 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
|
||||
Also die startMultiplayerGame muss JoinGame mit parametern für (HumanPlayer/AiEasy/AiNormal/AiHard, Semesteranzahl, Spielername) (3 Parameter) erhalten
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
public class JoinGame extends JPanel {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue