Browse Source

More powerAction work.

feature-config-parsing2
MagicBot 4 months ago
parent
commit
b9ccbe219f
  1. 22
      src/engine/wpak/PowersParser.java

22
src/engine/wpak/PowersParser.java

@ -10,6 +10,7 @@ package engine.wpak; @@ -10,6 +10,7 @@ package engine.wpak;
import engine.gameManager.ConfigManager;
import engine.mbEnums;
import engine.wpak.data.PowerAction;
import engine.wpak.data.PowerData;
import engine.wpak.data.PowerEntry;
import org.pmw.tinylog.Logger;
@ -106,12 +107,27 @@ public class PowersParser { @@ -106,12 +107,27 @@ public class PowersParser {
powerEntry.releaseAnim = Integer.parseInt(iterator.next());
powerEntry.targetSelect = mbEnums.TargetSelectType.valueOf(iterator.next());
// Process key value pairs after header
for (int x = 2; x < powerEntries.length; x++) {
// Parse key/pair values
// via switch
while (iterator.hasNext()) {
String lineValue = iterator.next();
String[] linevalues = lineValue.split("=");
String key = linevalues[0].trim();
switch (key) {
case "ACTION":
PowerAction powerAction = new PowerAction();
break;
default:
Logger.error("Unhandled variable type:" + key);
}
}
} catch (Exception e) {
Logger.error(powerEntry.power_id);
}

Loading…
Cancel
Save