Browse Source

More powerAction work.

feature-config-parsing2
MagicBot 3 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;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.mbEnums; import engine.mbEnums;
import engine.wpak.data.PowerAction;
import engine.wpak.data.PowerData; import engine.wpak.data.PowerData;
import engine.wpak.data.PowerEntry; import engine.wpak.data.PowerEntry;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@ -106,12 +107,27 @@ public class PowersParser {
powerEntry.releaseAnim = Integer.parseInt(iterator.next()); powerEntry.releaseAnim = Integer.parseInt(iterator.next());
powerEntry.targetSelect = mbEnums.TargetSelectType.valueOf(iterator.next()); powerEntry.targetSelect = mbEnums.TargetSelectType.valueOf(iterator.next());
// Process key value pairs after header
for (int x = 2; x < powerEntries.length; x++) { while (iterator.hasNext()) {
// Parse key/pair values
// via switch 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) { } catch (Exception e) {
Logger.error(powerEntry.power_id); Logger.error(powerEntry.power_id);
} }

Loading…
Cancel
Save