@@ -419,11 +419,10 @@ private CUnitType getUnitTypeInstance(final War3ID typeId, final BufferedImage b
419419 final float minimumAttackRange = unitType .getFieldAsInteger (MINIMUM_ATTACK_RANGE , 0 );
420420 final EnumSet <CTargetType > targetedAs = CTargetType
421421 .parseTargetTypeSet (unitType .getFieldAsString (TARGETED_AS , 0 ));
422- final String classificationString = unitType .getFieldAsString (CLASSIFICATION , 0 );
422+ final List < String > classificationStringList = unitType .getFieldAsList (CLASSIFICATION );
423423 final EnumSet <CUnitClassification > classifications = EnumSet .noneOf (CUnitClassification .class );
424- if (classificationString != null ) {
425- final String [] classificationValues = classificationString .split ("," );
426- for (final String unitEditorKey : classificationValues ) {
424+ if (!classificationStringList .isEmpty ()) {
425+ for (final String unitEditorKey : classificationStringList ) {
427426 final CUnitClassification unitClassification = CUnitClassification
428427 .parseUnitClassification (unitEditorKey );
429428 if (unitClassification != null ) {
@@ -464,9 +463,9 @@ private CUnitType getUnitTypeInstance(final War3ID typeId, final BufferedImage b
464463 final float rangeMotionBuffer = unitType .getFieldAsFloat (ATTACK1_RANGE_MOTION_BUFFER , 0 );
465464 final boolean showUI = unitType .getFieldAsBoolean (ATTACK1_SHOW_UI , 0 );
466465 final EnumSet <CTargetType > targetsAllowed = CTargetType
467- .parseTargetTypeSet (unitType .getFieldAsString (ATTACK1_TARGETS_ALLOWED , 0 ));
466+ .parseTargetTypeSet (unitType .getFieldAsList (ATTACK1_TARGETS_ALLOWED ));
468467 final String weaponSound = unitType .getFieldAsString (ATTACK1_WEAPON_SOUND , 0 );
469- String weapon_type_temp = unitType .getFieldAsString (ATTACK1_WEAPON_TYPE , 0 );
468+ final String weapon_type_temp = unitType .getFieldAsString (ATTACK1_WEAPON_TYPE , 0 );
470469 CWeaponType weaponType = CWeaponType .NONE ;
471470 if (!"_" .equals (weapon_type_temp )) {
472471 weaponType = CWeaponType .parseWeaponType (weapon_type_temp );
@@ -477,7 +476,8 @@ private CUnitType getUnitTypeInstance(final War3ID typeId, final BufferedImage b
477476 damageSidesPerDie , damageSpillDistance , damageSpillRadius , damageUpgradeAmount ,
478477 maximumNumberOfTargets , projectileArc , projectileArt , projectileHomingEnabled , projectileSpeed ,
479478 range , rangeMotionBuffer , showUI , targetsAllowed , weaponSound , weaponType ));
480- } catch (final Exception exc ) {
479+ }
480+ catch (final Exception exc ) {
481481 System .err .println ("Attack 1 failed to parse with: " + exc .getClass () + ":" + exc .getMessage ());
482482 }
483483 try {
@@ -516,9 +516,9 @@ private CUnitType getUnitTypeInstance(final War3ID typeId, final BufferedImage b
516516 final float rangeMotionBuffer = unitType .getFieldAsFloat (ATTACK2_RANGE_MOTION_BUFFER , 0 );
517517 boolean showUI = unitType .getFieldAsBoolean (ATTACK2_SHOW_UI , 0 );
518518 final EnumSet <CTargetType > targetsAllowed = CTargetType
519- .parseTargetTypeSet (unitType .getFieldAsString ( ATTACK2_TARGETS_ALLOWED , 0 ));
519+ .parseTargetTypeSet (unitType .getFieldAsList ( ATTACK1_TARGETS_ALLOWED ));
520520 final String weaponSound = unitType .getFieldAsString (ATTACK2_WEAPON_SOUND , 0 );
521- String weapon_type_temp = unitType .getFieldAsString (ATTACK2_WEAPON_TYPE , 0 );
521+ final String weapon_type_temp = unitType .getFieldAsString (ATTACK2_WEAPON_TYPE , 0 );
522522 CWeaponType weaponType = CWeaponType .NONE ;
523523 if (!"_" .equals (weapon_type_temp )) {
524524 weaponType = CWeaponType .parseWeaponType (weapon_type_temp );
@@ -540,7 +540,8 @@ private CUnitType getUnitTypeInstance(final War3ID typeId, final BufferedImage b
540540 damageSidesPerDie , damageSpillDistance , damageSpillRadius , damageUpgradeAmount ,
541541 maximumNumberOfTargets , projectileArc , projectileArt , projectileHomingEnabled , projectileSpeed ,
542542 range , rangeMotionBuffer , showUI , targetsAllowed , weaponSound , weaponType ));
543- } catch (final Exception exc ) {
543+ }
544+ catch (final Exception exc ) {
544545 System .err .println ("Attack 2 failed to parse with: " + exc .getClass () + ":" + exc .getMessage ());
545546 }
546547 final List <CUnitAttack > enabledAttacks = getEnabledAttacks (attacks , attacksEnabled );
@@ -691,7 +692,8 @@ public static List<CUnitTypeRequirement> parseRequirements(final List<String> re
691692 if (i < requirementsLevelsString .size ()) {
692693 if (requirementsLevelsString .get (i ).isEmpty ()) {
693694 level = 1 ;
694- } else {
695+ }
696+ else {
695697 try {
696698 level = Integer .parseInt (requirementsLevelsString .get (i ));
697699 }
@@ -704,14 +706,17 @@ else if (requirementsLevelsString.size() > 0) {
704706 final String requirementLevel = requirementsLevelsString .get (requirementsLevelsString .size () - 1 );
705707 if (requirementLevel .isEmpty ()) {
706708 level = 1 ;
707- } else {
709+ }
710+ else {
708711 try {
709712 level = Integer .parseInt (requirementLevel );
710- } catch (final NumberFormatException exc ) {
713+ }
714+ catch (final NumberFormatException exc ) {
711715 level = 1 ;
712716 }
713717 }
714- } else {
718+ }
719+ else {
715720 level = 1 ;
716721 }
717722 requirements .add (new CUnitTypeRequirement (War3ID .fromString (item ), level ));
@@ -731,7 +736,8 @@ private static int[] populateHeroStatTable(final int maxHeroLevel, final float s
731736 final float newSumBonusAtLevel = sumBonusAtLevel + statPerLevel ;
732737 if (i == 0 ) {
733738 table [i ] = (int ) newSumBonusAtLevel ;
734- } else {
739+ }
740+ else {
735741 table [i ] = (int ) newSumBonusAtLevel - table [i - 1 ];
736742 }
737743 sumBonusAtLevel = newSumBonusAtLevel ;
0 commit comments