-
Notifications
You must be signed in to change notification settings - Fork 0
/
Data.java
34 lines (29 loc) · 1.2 KB
/
Data.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Import statements
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Data {
MainChar[] saveSlots = new MainChar[3];
int index;
public Data() throws FileNotFoundException {
Scanner fileParser = new Scanner(new File("data.txt"));
while (fileParser.hasNextLine()) {
String curLine = fileParser.nextLine();
if (curLine.contains("slot")) {
index = curLine.charAt(4);
}
// Ignore for now, not done yet
int str = Integer.parseInt(fileParser.nextLine());
int con = Integer.parseInt(fileParser.nextLine());
int dex = Integer.parseInt(fileParser.nextLine());
int wis = Integer.parseInt(fileParser.nextLine());
int armorRank = Integer.parseInt(fileParser.nextLine());
int weapRank = Integer.parseInt(fileParser.nextLine());
int xp = Integer.parseInt(fileParser.nextLine());
String inventoryLine = fileParser.nextLine();
int amtOfItems = (int) inventoryLine.chars().filter(ch -> ch == ' ').count();
for (int i = 0; i < amtOfItems; i++) {
}
}
}
}