Skip to content

Commit

Permalink
Began system csv importing. Messy. Need System class.
Browse files Browse the repository at this point in the history
  • Loading branch information
gint271 committed Sep 27, 2017
1 parent 56ed0ba commit 7daec2b
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion Seller.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@

// Main class, to be run at the start of mining.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.*;

public class Seller {

public enum PadSize {SMALL, MEDIUM, LARGE};

private final static int ID_INDEX = 0;
private final static int NAME_INDEX = 2;
private final static int X_INDEX = 3;
private final static int Y_INDEX = 4;
private final static int Z_INDEX = 5;
private final static int POPULATION_INDEX = 6;

public static void main(String[] args) {
// Record start time
Expand Down Expand Up @@ -50,13 +59,41 @@ public static void main(String[] args) {
cargo = new ShipHold("./TestFiles/Journal.170925125640.01",
startTime);
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("Failed to read log. " + e);
sc.close();
return;
}

// Calculate best stations
FileReader fr;
try {
fr = new FileReader("./TestFiles/systems.csv");
} catch (IOException e) {
System.out.println("Failed to open system file. " + e);
sc.close();
return;
}
BufferedReader systemReader = new BufferedReader(fr);
Map<Integer, Point3D> systemMap = new HashMap<Integer, Point3D>();
String currentLine;
int originID;
// TODO: Make a system object.
try {
while ((currentLine = systemReader.readLine()) != null) {
String systemElements[] = currentLine.split(",");
if (systemElements[NAME_INDEX].equals("\"GCRV 1568\"")) {
System.out.println(currentLine);
originID = Integer.parseInt(systemElements[ID_INDEX]);

} else if ()
}
} catch (IOException e) {
System.out.println("Failed to read system file. " + e);
sc.close();
return;
}

System.out.println("Done");

// Output to user

Expand Down

0 comments on commit 7daec2b

Please sign in to comment.