Added error handling in Menu babylon stylez
This commit is contained in:
parent
55940e42ae
commit
20dff9e8c6
@ -7,8 +7,7 @@ import java.io.InputStreamReader;
|
|||||||
import java.lang.reflect.InvocationTargetException;
|
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) throws IOException, InvocationTargetException, IllegalAccessException {
|
||||||
{
|
|
||||||
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!");
|
||||||
|
|
||||||
@ -18,6 +17,7 @@ public class Menu {
|
|||||||
|
|
||||||
boolean isExiting = false;
|
boolean isExiting = false;
|
||||||
while (!isExiting) {
|
while (!isExiting) {
|
||||||
|
try {
|
||||||
String[] input = br.readLine().split(" ");
|
String[] input = br.readLine().split(" ");
|
||||||
switch (input[0]) {
|
switch (input[0]) {
|
||||||
case "loadMap":
|
case "loadMap":
|
||||||
@ -55,6 +55,11 @@ public class Menu {
|
|||||||
isExiting = true;
|
isExiting = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
//TODO not so granular error handling
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user