Fix: MVC (Client) Add:IClient

This commit is contained in:
rubenpirreram
2026-04-30 18:34:40 +02:00
parent d66af3a112
commit 5246818fca
6 changed files with 127 additions and 15 deletions
@@ -8,7 +8,7 @@ import it.polimi.ingsw.gc14.View.TUI.TUI;
import java.util.Scanner;
public class ClientLauncherTUI {
private IView view;
private TUI view;
public void main() throws InterruptedException {
view=new TUI(null);
ClientController controller = new ClientController(view);
@@ -34,22 +34,30 @@ public class ClientLauncherTUI {
System.out.println("RMI connection refused\n\n");
return;
}
controller.setClient(client);
int h;
while(controller.localController.getModel()==null){
h = scanner.nextInt();
if(controller.localController.getModel()!=null)
{
break;
}
}
while(true) {
int h = scanner.nextInt();
h = scanner.nextInt();
}
} else if (networkType == 1) {
TCPClient client = new TCPClient(controller, "localhost", 8080);
if (client.start(username, proposedNumPlayers)) {
if (client.connect(username, proposedNumPlayers)) {
System.out.println("Succesfully connected to TCP server\n\n");
} else {
System.out.println("TCP connection refused\n\n");
return;
}
controller.setClient(client);
while(true) {
int h = scanner.nextInt();
}