backup
This commit is contained in:
2
projekt/.gitingore
Normal file
2
projekt/.gitingore
Normal file
@@ -0,0 +1,2 @@
|
||||
*.class
|
||||
*.~ava
|
||||
BIN
projekt/Game.class
Normal file
BIN
projekt/Game.class
Normal file
Binary file not shown.
30
projekt/Game.java
Normal file
30
projekt/Game.java
Normal file
@@ -0,0 +1,30 @@
|
||||
import java.util.Random;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Game {
|
||||
public static Helper helper;
|
||||
public static Menu menu;
|
||||
public static Scanner input;
|
||||
public static void main(String args[]) {
|
||||
|
||||
|
||||
|
||||
boolean end = false;
|
||||
|
||||
init();
|
||||
|
||||
while (!end) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
helper = new Helper();
|
||||
input = new Scanner(System.in);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
30
projekt/Game.~ava
Normal file
30
projekt/Game.~ava
Normal file
@@ -0,0 +1,30 @@
|
||||
import java.util.Random;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class Game {
|
||||
public static Helper helper;
|
||||
public static Menu menu;
|
||||
public static Scanner input;
|
||||
public static void main(String args[]) {
|
||||
|
||||
|
||||
|
||||
boolean end = false;
|
||||
|
||||
init();
|
||||
|
||||
while (!end) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
helper = new Helper();
|
||||
input = new Scanner(System.in);
|
||||
|
||||
menu = new Menu(this);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
BIN
projekt/Helper.class
Normal file
BIN
projekt/Helper.class
Normal file
Binary file not shown.
10
projekt/Helper.java
Normal file
10
projekt/Helper.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class Helper {
|
||||
public int getRandomNumber(int max) {
|
||||
return ((int)(Math.random() * (max+1)));
|
||||
|
||||
}
|
||||
public void printBarLine() {
|
||||
System.out.println("---------------------------------------------------");
|
||||
|
||||
}
|
||||
}
|
||||
7
projekt/Helper.~ava
Normal file
7
projekt/Helper.~ava
Normal file
@@ -0,0 +1,7 @@
|
||||
public class Helper {
|
||||
public int getRandomNumber(int max) {
|
||||
return ((int)(Math.random() * (max+1)));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
BIN
projekt/Menu.class
Normal file
BIN
projekt/Menu.class
Normal file
Binary file not shown.
39
projekt/Menu.java
Normal file
39
projekt/Menu.java
Normal file
@@ -0,0 +1,39 @@
|
||||
import java.util.Scanner;
|
||||
public class Menu {
|
||||
public Game game;
|
||||
public Scanner input;
|
||||
public int state = 0;
|
||||
|
||||
public Menu(Game _game) {
|
||||
game = _game;
|
||||
//input = _game.input;
|
||||
|
||||
}
|
||||
public void getMenu() {
|
||||
switch (state) {
|
||||
case 1:
|
||||
printStateCity();
|
||||
break;
|
||||
case 0:
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void printStateCity() {
|
||||
System.out.println("You are in city: ");
|
||||
System.out.println("What are you going to do?");
|
||||
System.out.println("S - Shop, A - Adventure, G - Guild");
|
||||
String choice = "";
|
||||
if(input.hasNext()) {
|
||||
choice = input.next();
|
||||
|
||||
}
|
||||
|
||||
game.helper.printBarLine();
|
||||
}
|
||||
|
||||
}
|
||||
39
projekt/Menu.~ava
Normal file
39
projekt/Menu.~ava
Normal file
@@ -0,0 +1,39 @@
|
||||
import java.util.Scanner;
|
||||
public class Menu {
|
||||
public Game game;
|
||||
public Scanner input;
|
||||
public int state = 0;
|
||||
|
||||
public Menu(Game _game) {
|
||||
game = _game;
|
||||
//input = _game.input;
|
||||
|
||||
}
|
||||
public static void getMenu() {
|
||||
switch (state) {
|
||||
case 1:
|
||||
printStateCity();
|
||||
break;
|
||||
case 0:
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void printStateCity() {
|
||||
System.out.println("You are in city: ");
|
||||
System.out.println("What are you going to do?");
|
||||
System.out.println("S - Shop, A - Adventure, G - Guild");
|
||||
String choice = "";
|
||||
if(input.hasNext()) {
|
||||
choice = input.next();
|
||||
|
||||
}
|
||||
|
||||
game.helper.printBarLine();
|
||||
}
|
||||
|
||||
}
|
||||
13
projekt/error.txt
Normal file
13
projekt/error.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
Menu.java:31: Fehler: Variable input ist nicht statisch und kann nicht aus einem statischen Kontext referenziert werden
|
||||
if(input.hasNext()) {
|
||||
^
|
||||
Menu.java:32: Fehler: Variable input ist nicht statisch und kann nicht aus einem statischen Kontext referenziert werden
|
||||
choice = input.next();
|
||||
^
|
||||
Menu.java:36: Fehler: Variable game ist nicht statisch und kann nicht aus einem statischen Kontext referenziert werden
|
||||
game.helper.printBarLine();
|
||||
^
|
||||
H:\Java\projekt\Game.java:25: Fehler: Variable this ist nicht statisch und kann nicht aus einem statischen Kontext referenziert werden
|
||||
menu = new Menu(this);
|
||||
^
|
||||
4 Fehler
|
||||
Reference in New Issue
Block a user