(StringBuilder buffer)
| 1338 | * ############################################################### |
| 1339 | */ |
| 1340 | private void appendAbilityLines(StringBuilder buffer) |
| 1341 | { |
| 1342 | ArrayList<AbilityCategory> categories = new ArrayList<>(getGameMode().getAllAbilityCategories()); |
| 1343 | categories.add(AbilityCategory.LANGBONUS); |
| 1344 | |
| 1345 | Collection<CNAbilitySelection> virtSave = thePC.getSaveAbilities(); |
| 1346 | |
| 1347 | categories.sort(Comparator.comparing(AbilityCategory::getKeyName)); |
| 1348 | |
| 1349 | for (final AbilityCategory cat : categories) |
| 1350 | { |
| 1351 | final List<CNAbility> normalAbilitiesToSave = new ArrayList<>(thePC.getPoolAbilities(cat, Nature.NORMAL)); |
| 1352 | |
| 1353 | // ABILITY:FEAT|NORMAL|Feat Key|APPLIEDTO:xxx|TYPE:xxx|SAVE:xxx|DESC:xxx |
| 1354 | Collections.sort(normalAbilitiesToSave); |
| 1355 | for (final CNAbility ability : normalAbilitiesToSave) |
| 1356 | { |
| 1357 | writeAbilityToBuffer(buffer, ability); |
| 1358 | } |
| 1359 | boolean hasVirt = false; |
| 1360 | for (final CNAbilitySelection ability : virtSave) |
| 1361 | { |
| 1362 | CNAbility cnAbility = ability.getCNAbility(); |
| 1363 | if (cnAbility.getAbilityCategory().equals(cat)) |
| 1364 | { |
| 1365 | //TODO Need to write each CNAbility only once :/ |
| 1366 | writeAbilityToBuffer(buffer, cnAbility); |
| 1367 | hasVirt = true; |
| 1368 | } |
| 1369 | } |
| 1370 | if (!normalAbilitiesToSave.isEmpty() || hasVirt || thePC.getUserPoolBonus(cat) != 0.0) |
| 1371 | { |
| 1372 | buffer.append(IOConstants.TAG_USERPOOL).append(IOConstants.TAG_END); |
| 1373 | buffer.append(EntityEncoder.encode(cat.getKeyName())).append(IOConstants.TAG_SEPARATOR); |
| 1374 | buffer.append(IOConstants.TAG_POOLPOINTS).append(IOConstants.TAG_END); |
| 1375 | buffer.append(thePC.getUserPoolBonus(cat)); |
| 1376 | buffer.append(IOConstants.LINE_SEP); |
| 1377 | } |
| 1378 | } |
| 1379 | } |
| 1380 | |
| 1381 | private void writeAbilityToBuffer(StringBuilder buffer, CNAbility cna) |
| 1382 | { |
no test coverage detected