Changed: Now Disconnection request can be sent , (TUI,RMI,TCP)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package it.polimi.ingsw.gc14;
|
||||
import it.polimi.ingsw.gc14.Controller.ClientController;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||
import it.polimi.ingsw.gc14.Network.NetworkEvent;
|
||||
import it.polimi.ingsw.gc14.Network.RMI.Client.RMIClient;
|
||||
import it.polimi.ingsw.gc14.Network.TCP.Client.TCPClient;
|
||||
@@ -38,6 +39,7 @@ public class ClientLauncherTUI {
|
||||
*/
|
||||
public void main() throws InterruptedException {
|
||||
view = new TUI(null);
|
||||
admissibleChar.add("0");
|
||||
admissibleChar.add("1");
|
||||
admissibleChar.add("2");
|
||||
admissibleChar.add("3");
|
||||
@@ -137,7 +139,16 @@ public class ClientLauncherTUI {
|
||||
|
||||
if(admissibleChar.contains(action))
|
||||
{
|
||||
if (!action.equals("6") && !action.equals("A") && !action.equals("B") && !action.equals("C")&&!action.equals("a") && !action.equals("b") && !action.equals("c")) {
|
||||
if(action.equals("0"))
|
||||
{
|
||||
System.out.println("Are you sure? Y/N");
|
||||
String c= scanner.next();
|
||||
if(!c.equals("Y") && !c.equals("y"))
|
||||
{
|
||||
view.render();
|
||||
return;
|
||||
}
|
||||
}else if (!action.equals("6") && !action.equals("A") && !action.equals("B") && !action.equals("C")&&!action.equals("a") && !action.equals("b") && !action.equals("c")) {
|
||||
try {
|
||||
System.out.println("Insert the required position:");
|
||||
pos = scanner.nextInt();
|
||||
@@ -147,6 +158,10 @@ public class ClientLauncherTUI {
|
||||
}
|
||||
}
|
||||
switch (action) {
|
||||
case "0" -> {
|
||||
controller.disconnect();
|
||||
System.exit(0);
|
||||
}
|
||||
case "1" -> controller.slotChoice(username, pos);
|
||||
case "2" -> controller.drawUpperTribeCard(username, pos);
|
||||
case "3" -> controller.drawUpperBuildingCard(username, pos);
|
||||
|
||||
Reference in New Issue
Block a user