/* Alliance info */
public void importAlliancesScoring(HashMap<MatchGeneral, MatchDetailRelicJSON> scores){
        File allianceFile = new File(Config.SCORING_DIR + File.separator + "alliances.txt");
        if (allianceFile.exists()) {
            try {
                BufferedReader reader = new BufferedReader(new FileReader(allianceFile));
                String line;
                alliances = new Alliance[4];
                while ((line = reader.readLine()) != null) {
                    /* Alliance info */
                    String[] allianceInfo = line.split("\\|");
                    int division = Integer.parseInt(allianceInfo[0]);
                    int allianceNumber = Integer.parseInt(allianceInfo[1]);
                    int[] allianceNumbers = {Integer.parseInt(allianceInfo[3]), Integer.parseInt(allianceInfo[4]), Integer.parseInt(allianceInfo[5])};
                    alliances[allianceNumber-1] = new Alliance(division, allianceNumber, allianceNumbers);
                }
                reader.close();
                /* TODO - Make Upload Alliances so we can uncomment this
                controller.btnUploadAlliances.setDisable(false);*/
                updateAllianceLabels(scores);
                TOALogger.log(Level.INFO, "Alliance import successful.");
            } catch (Exception e) {
                e.printStackTrace();
                controller.sendError("Could not open file. " + e.getLocalizedMessage());
            }
        } else {
            controller.sendError("Could not locate alliances.txt from the Scoring System. Did you generate an elimination bracket?");
        }
    }
alliances = new Alliance[4];
while ((line = reader.readLine()) != null) {
/* Alliance info */
String[] allianceInfo = line.split("\\|");
int division = Integer.parseInt(allianceInfo[0]);
public void importAlliancesScoring(HashMap<MatchGeneral, MatchDetailRelicJSON> scores){
File allianceFile = new File(Config.SCORING_DIR + File.separator + "alliances.txt");
if (allianceFile.exists()) {
try {
BufferedReader reader = new BufferedReader(new FileReader(allianceFile));
String line;
alliances = new Alliance[4];
while ((line = reader.readLine()) != null) {
/* Alliance info */
String[] allianceInfo = line.split("\\|");
int division = Integer.parseInt(allianceInfo[0]);
int allianceNumber = Integer.parseInt(allianceInfo[1]);
int[] allianceNumbers = {Integer.parseInt(allianceInfo[3]), Integer.parseInt(allianceInfo[4]), Integer.parseInt(allianceInfo[5])};
alliances[allianceNumber-1] = new Alliance(division, allianceNumber, allianceNumbers);
}
reader.close();
/* TODO - Make Upload Alliances so we can uncomment this
controller.btnUploadAlliances.setDisable(false);*/
updateAllianceLabels(scores);
public void importAlliancesScoring(HashMap<MatchGeneral, MatchDetailRelicJSON> scores){
File allianceFile = new File(Config.SCORING_DIR + File.separator + "alliances.txt");
if (allianceFile.exists()) {
try {
BufferedReader reader = new BufferedReader(new FileReader(allianceFile));
String line;
alliances = new Alliance[4];
while ((line = reader.readLine()) != null) {
/* Alliance info */
String[] allianceInfo = line.split("\\|");
int division = Integer.parseInt(allianceInfo[0]);
int allianceNumber = Integer.parseInt(allianceInfo[1]);
int[] allianceNumbers = {Integer.parseInt(allianceInfo[3]), Integer.parseInt(allianceInfo[4]), Integer.parseInt(allianceInfo[5])};
alliances[allianceNumber-1] = new Alliance(division, allianceNumber, allianceNumbers);
}
reader.close();
/* TODO - Make Upload Alliances so we can uncomment this
controller.btnUploadAlliances.setDisable(false);*/
updateAllianceLabels(scores);
TOALogger.log(Level.INFO, "Alliance import successful.");
} catch (Exception e) {
e.printStackTrace();
controller.sendError("Could not open file. " + e.getLocalizedMessage());
}
} else {
controller.sendError("Could not locate alliances.txt from the Scoring System. Did you generate an elimination bracket?");
}
}