everything basically
This commit is contained in:
62
HockeyStats.java
Normal file
62
HockeyStats.java
Normal file
@@ -0,0 +1,62 @@
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class HockeyStats {
|
||||
static PlayerList players = new PlayerList();
|
||||
static BufferedReader br;
|
||||
static StringTokenizer st;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
loadData("data.txt");
|
||||
Scanner s = new Scanner(System.in);
|
||||
while (true) {
|
||||
showMenu();
|
||||
int n = s.nextInt();
|
||||
switch (n) {
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
case 3:
|
||||
break;
|
||||
case 4:
|
||||
break;
|
||||
default:
|
||||
System.out.println("Please choose one of the available menu options!");
|
||||
continue;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
s.close();
|
||||
}
|
||||
|
||||
public static void loadData(String fileName) throws Exception {
|
||||
File f = new File(fileName);
|
||||
br = new BufferedReader(new FileReader(f));
|
||||
st = new StringTokenizer(br.readLine());
|
||||
}
|
||||
|
||||
public static void saveData(String fileName) throws Exception {
|
||||
FileWriter fw = new FileWriter(fileName);
|
||||
String s = players.createSaveData();
|
||||
fw.write(s);
|
||||
fw.close();
|
||||
}
|
||||
|
||||
public static void showMenu() {
|
||||
System.out.print(
|
||||
"""
|
||||
<---------------------------->
|
||||
Hockey Stats Manager Menu
|
||||
Select an option:
|
||||
|
||||
(1) Load Data from Files
|
||||
(2) Open Data Editor
|
||||
(3) Open Stats View Menu
|
||||
(4) Quit
|
||||
|
||||
<---------------------------->
|
||||
""");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user