Well, I took some of your advice as far as OOP, and made a unitStats class which knows its own stats, etc, and then I build the unit by giving it its race and two classes. These values provide the necessary offset to reference the correct parts of the spreadsheet I'm using to hold all this data, which is done when the unit is instantiated. My issue now is an odd ArrayOutOfBounds exception that I can't put my finger on. The relevant code for unitData is below and the junk code I'm using to test it is below that.
public unitData(int a, int b, int c) throws BiffException, IOException
{
Workbook workbook = Workbook.getWorkbook(new File("Job Stats FFTA2.xls"));
Sheet sheet = workbook.getSheet(0);
switch(a)
{ //determines the offset from the top of the sheet to draw data from
case 1: race = 1;
case 2: race = 15;
case 3: race = 28;
case 4: race = 40;
case 5: race = 53;
case 6: race = 65;
}
pClass = b;
sClass = c;
Cell cell; //the cell taken temporarily from the sheet
int prisoner; //the data contained in the cell
for(int x=0;x<7;x++){
cell = sheet.getCell(race+b,x+9);
prisoner = Integer.parseInt(cell.getContents());
unitStats[x]+=prisoner;} //adds the base stats for the primary class.
for(int x=0;x<7;x++){
cell = sheet.getCell(race+b,x);
prisoner = Integer.parseInt(cell.getContents());
unitStats[x]+=prisoner;} //adds the growths for the primary class
for(int x=0;x<7;x++){
cell = sheet.getCell(race+c,x);
prisoner = Integer.parseInt(cell.getContents());
unitStats[x]+=prisoner;} //adds the growths for the secondary class
hpMax = unitStats[0]; //sets max HP for later calculations
mpMax = unitStats[1]; //sets max HP for later calculations
}
unitData fred = new unitData(1,5,3);
System.out.println(fred.getHP());
An online version of the spreadsheet used is available here:
https://docs.google.com/spreadsheet/...Xc&pli=1#gid=0