From 55d56e41b28e21d4afcd08ce8d38feb8ccb29bf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bokros=20B=C3=A1lint?= Date: Mon, 25 Apr 2016 23:07:49 +0200 Subject: [PATCH] Swapped unnecessary menu with another unnecessary menu --- cicaprojekt/Menu.java | 146 +++++++++--------------------------------- 1 file changed, 30 insertions(+), 116 deletions(-) diff --git a/cicaprojekt/Menu.java b/cicaprojekt/Menu.java index e2bf0c9..75f196a 100644 --- a/cicaprojekt/Menu.java +++ b/cicaprojekt/Menu.java @@ -1,129 +1,43 @@ 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("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!"); - boolean isExiting = false; - 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("O’Neill [é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; - } + Tester tester = new Tester(); + 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; } + } }