Cleaned up Menu
Code Your Own Game
This commit is contained in:
parent
2d03e81f49
commit
412c37c1da
@ -1,65 +1,8 @@
|
|||||||
package cicaprojekt;
|
package cicaprojekt;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.Console;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
|
|
||||||
public class Menu {
|
public class Menu {
|
||||||
public static void main(String[] args) throws IOException, InvocationTargetException, IllegalAccessException {
|
public static void main(String[] args) {
|
||||||
System.out.println("Continuously Integrated Cica Projekt - Proto");
|
System.out.println("Continuously Integrated Cica Projekt - Proto");
|
||||||
System.out.println("Üdvözöllek a Babylon Simulator 2000 játékban! Kérlek válassz egy menüpontot!");
|
System.out.println("Üdvözöllek a Babylon Simulator 2000 játékban! Kérlek válassz egy menüpontot!");
|
||||||
|
|
||||||
Tester tester = new Tester();
|
|
||||||
|
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
|
||||||
|
|
||||||
boolean isExiting = false;
|
|
||||||
while (!isExiting) {
|
|
||||||
try {
|
|
||||||
String[] input = br.readLine().split(" ");
|
|
||||||
switch (input[0]) {
|
|
||||||
case "loadMap":
|
|
||||||
tester.loadMap(input[1]);
|
|
||||||
break;
|
|
||||||
case "listPlayers":
|
|
||||||
System.out.println(tester.listPlayers());
|
|
||||||
break;
|
|
||||||
case "move":
|
|
||||||
tester.move(input[1]);
|
|
||||||
break;
|
|
||||||
case "boxLift":
|
|
||||||
System.out.println(tester.boxLift(input[1]));
|
|
||||||
break;
|
|
||||||
case "boxDrop":
|
|
||||||
System.out.println(tester.boxDrop(input[1]));
|
|
||||||
break;
|
|
||||||
case "shootONeillsGun":
|
|
||||||
tester.shootONeillsGun(input[1]);
|
|
||||||
break;
|
|
||||||
case "rotate":
|
|
||||||
tester.rotate(input[1], input[2]);
|
|
||||||
break;
|
|
||||||
case "listStargates":
|
|
||||||
System.out.println(tester.listStargates());
|
|
||||||
break;
|
|
||||||
case "runAllTests":
|
|
||||||
boolean testresult = tester.runAllTests();
|
|
||||||
if (testresult)
|
|
||||||
System.out.println("All tests successful!");
|
|
||||||
else
|
|
||||||
System.out.println("Tests failed!");
|
|
||||||
break;
|
|
||||||
case "exit":
|
|
||||||
isExiting = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
//TODO not so granular error handling
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user