cicaprojekt/cicaprojekt/Menu.java
Bokros Bálint b7b182cf7d created Menu
2016-04-01 17:48:00 +02:00

131 lines
4.9 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cicaprojekt;
import java.io.IOException;
import java.util.Scanner;
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{
System.out.println("Continuously Integrated Cica Projekt - Skeleton");
System.out.println("Üdvözöllek a Babylon Simulator 2000 játékban! Kérlek válassz egy menüpontot!");
boolean isExiting = false;
while(!isExiting) {
System.out.println("1. Lépés");
System.out.println("2. Doboz felvétele");
System.out.println("3. Doboz felvétele");
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");
ONeill oNeill = new ONeill();
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;
}
}
}
}