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); String in = System.console().readLine();
String[] input = in.split(" ");
Scanner sc = new Scanner(System.in); switch (input[0]) {
case "loadMap" :
switch (sc.nextLine().charAt(0)) { tester.loadMap(input[1]);
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; break;
case 'A': case "listPlayers" :
oNeill.move(Direction.WEST); tester.listPlayers();
break; break;
case 'S': case "move" :
oNeill.move(Direction.SOUTH); tester.move(input[1]);
break; break;
case 'D': case "boxLift" :
oNeill.move(Direction.EAST); tester.boxLift(input[1]);
break; break;
case 'X': case "boxDrop" :
tester.boxDrop(input[1]);
break; break;
} case "shootONeillsGun" :
tester.shootONeillsGun(input[1]);
break; break;
case '2': case "rotate" :
System.out.println("Doboz felvétele"); tester.rotate(input[1], input[2]);
System.out.println("Elfogadott bemenet: L");
switch (sc.nextLine().charAt(0)) {
case 'L':
oNeill.boxLift();
break; break;
case 'X': case "listStargates"
break; tester.listStargates();
}
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; break;
} }
}
} }
} }