Fix: MVC (Client) Add:IClient
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user