Swapped unnecessary menu with another unnecessary menu

This commit is contained in:
Bokros Bálint 2016-04-25 23:07:49 +02:00
parent a4e3247aa6
commit 55d56e41b2

View File

@ -1,129 +1,43 @@
package cicaprojekt; package cicaprojekt;
import java.io.IOException; import java.io.IOException;
import java.util.Scanner;
public class Menu { public class Menu {
public static String tabulator = "\t";
public static void addTab() {
tabulator += '\t';
}
public static void removeTab() {
tabulator = tabulator.substring(0, tabulator.length() - 1);
}
public static void main(String[] args) throws IOException { public static void main(String[] args) throws IOException {
System.out.println("Continuously Integrated Cica Projekt - Skeleton"); 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!");
boolean isExiting = false; Tester tester = new Tester();
while (!isExiting) {
System.out.println("1. Lépés");
System.out.println("2. Doboz felvétele");
System.out.println("3. Doboz lerakása");
System.out.println("4. Elforgatás");
System.out.println("5. Nézés");
System.out.println("6. Csillagkapu lövés");
System.out.println("X. Kilépés");
Player oNeill = new Player(new Field(), Direction.NORTH);
Scanner sc = new Scanner(System.in);
switch (sc.nextLine().charAt(0)) {
case '1':
System.out.println("ONeill [északi|nyugati|déli|keleti] irányba lép egyet,");
System.out.println("Elfogadott bemenet: W, A, S, D");
switch (sc.nextLine().charAt(0)) {
case 'W':
oNeill.move(Direction.NORTH);
break;
case 'A':
oNeill.move(Direction.WEST);
break;
case 'S':
oNeill.move(Direction.SOUTH);
break;
case 'D':
oNeill.move(Direction.EAST);
break;
case 'X':
break;
}
break;
case '2':
System.out.println("Doboz felvétele");
System.out.println("Elfogadott bemenet: L");
switch (sc.nextLine().charAt(0)) {
case 'L':
oNeill.boxLift();
break;
case 'X':
break;
}
break;
case '3':
System.out.println("Doboz lerakása");
System.out.println("Elfogadott bemenet: D");
switch (sc.nextLine().charAt(0)) {
case 'D':
oNeill.boxDrop();
break;
case 'X':
break;
}
break;
case '4':
System.out.println("Elforgás");
System.out.println("Elfogadott bemenet: L, R");
switch (sc.nextLine().charAt(0)) {
case 'L':
oNeill.rotateLeft();
break;
case 'D':
oNeill.rotateRight();
break;
case 'X':
break;
}
break;
case '5':
System.out.println("Nézés");
System.out.println("Elfogadott bemenet: W");
switch (sc.nextLine().charAt(0)) {
case 'W':
Tile t = oNeill.getCurrentTile().getAdjacentTile(oNeill.getFacingDirection());
System.out.println("O'Neill előtt egy " + t.toString() + "mező található");
break;
case 'X':
break;
}
break;
case '6':
System.out.println("Csillagkapu lövés");
System.out.println("Elfogadott bemenet: Y, B");
Tile t = oNeill.getCurrentTile();
switch (sc.nextLine().charAt(0)) {
case 'Y':
t.spawnStargate(Stargate.yellowStargate, oNeill.getFacingDirection());
break;
case 'B':
t.spawnStargate(Stargate.blueStargate, oNeill.getFacingDirection());
break;
case 'X':
break;
}
break;
case 'X':
System.out.println("Kilépés");
isExiting = true;
break;
}
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;
} }
} }
} }