Fixed Menu
This commit is contained in:
parent
7c7c1ce9f9
commit
9436508c60
@ -1,6 +1,8 @@
|
||||
package cicaprojekt;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class Menu {
|
||||
public static void main(String[] args) throws IOException {
|
||||
@ -9,33 +11,40 @@ public class Menu {
|
||||
|
||||
Tester tester = new Tester();
|
||||
|
||||
String in = System.console().readLine();
|
||||
String[] input = in.split(" ");
|
||||
switch (input[0]) {
|
||||
case "loadMap" :
|
||||
tester.loadMap(input[1]);
|
||||
break;
|
||||
case "listPlayers" :
|
||||
tester.listPlayers();
|
||||
break;
|
||||
case "move" :
|
||||
tester.move(input[1]);
|
||||
break;
|
||||
case "boxLift" :
|
||||
tester.boxLift(input[1]);
|
||||
break;
|
||||
case "boxDrop" :
|
||||
tester.boxDrop(input[1]);
|
||||
break;
|
||||
case "shootONeillsGun" :
|
||||
tester.shootONeillsGun(input[1]);
|
||||
break;
|
||||
case "rotate" :
|
||||
tester.rotate(input[1], input[2]);
|
||||
break;
|
||||
case "listStargates" :
|
||||
tester.listStargates();
|
||||
break;
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
||||
|
||||
boolean isExiting = false;
|
||||
while(!isExiting) {
|
||||
String[] input = br.readLine().split(" ");
|
||||
switch (input[0]) {
|
||||
case "loadMap":
|
||||
tester.loadMap(input[1]);
|
||||
break;
|
||||
case "listPlayers":
|
||||
tester.listPlayers();
|
||||
break;
|
||||
case "move":
|
||||
tester.move(input[1]);
|
||||
break;
|
||||
case "boxLift":
|
||||
tester.boxLift(input[1]);
|
||||
break;
|
||||
case "boxDrop":
|
||||
tester.boxDrop(input[1]);
|
||||
break;
|
||||
case "shootONeillsGun":
|
||||
tester.shootONeillsGun(input[1]);
|
||||
break;
|
||||
case "rotate":
|
||||
tester.rotate(input[1], input[2]);
|
||||
break;
|
||||
case "listStargates":
|
||||
tester.listStargates();
|
||||
break;
|
||||
case "exit":
|
||||
isExiting = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user