mirror of
https://github.com/Klagarge/PokeHES.git
synced 2025-10-30 11:19:17 +00:00
file in jar
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
package Text;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Vector;
|
||||
|
||||
public class FightData {
|
||||
|
||||
private Vector<Attack> attacks = new Vector<Attack>();
|
||||
private File file;
|
||||
private InputStream stream;
|
||||
private static String regex = ";";
|
||||
|
||||
public int nbr_line =0;
|
||||
|
||||
public FightData(String branch) {
|
||||
file = new File("./data/battle/fight/" + branch + ".csv");
|
||||
stream = FightData.class.getResourceAsStream("/battle/fight/" + branch + ".csv");
|
||||
}
|
||||
|
||||
public void readFile() {
|
||||
@@ -23,8 +23,7 @@ public class FightData {
|
||||
String line = "";
|
||||
|
||||
try {
|
||||
FileReader f = new FileReader(file, StandardCharsets.UTF_8);
|
||||
BufferedReader bf = new BufferedReader(f);
|
||||
BufferedReader bf = new BufferedReader(new InputStreamReader(stream, StandardCharsets.UTF_8));
|
||||
|
||||
//add the line in the vector attacks of attack
|
||||
line = bf.readLine();
|
||||
|
||||
Reference in New Issue
Block a user