(final String line)
| 4405 | } |
| 4406 | |
| 4407 | private void parseVFeatLine(final String line) |
| 4408 | { |
| 4409 | final PCGTokenizer tokens; |
| 4410 | |
| 4411 | try |
| 4412 | { |
| 4413 | tokens = new PCGTokenizer(line); |
| 4414 | } |
| 4415 | catch (PCGParseException pcgpex) |
| 4416 | { |
| 4417 | final String message = |
| 4418 | "Illegal VFeat line ignored: " + line + Constants.LINE_SEPARATOR + "Error: " + pcgpex.getMessage(); |
| 4419 | warnings.add(message); |
| 4420 | |
| 4421 | return; |
| 4422 | } |
| 4423 | |
| 4424 | final Iterator<PCGElement> it = tokens.getElements().iterator(); |
| 4425 | |
| 4426 | // the first element defines the Feat key name |
| 4427 | if (it.hasNext()) |
| 4428 | { |
| 4429 | final PCGElement element = it.next(); |
| 4430 | |
| 4431 | final String abilityKey = EntityEncoder.decode(element.getText()); |
| 4432 | Ability anAbility = Globals.getContext().getReferenceContext().getManufacturerId(AbilityCategory.FEAT) |
| 4433 | .getActiveObject(abilityKey); |
| 4434 | |
| 4435 | if (anAbility == null) |
| 4436 | { |
| 4437 | final String message = "Could not add vfeat: " + abilityKey; |
| 4438 | warnings.add(message); |
| 4439 | |
| 4440 | return; |
| 4441 | } |
| 4442 | CNAbility cna = CNAbilityFactory.getCNAbility(AbilityCategory.FEAT, Nature.VIRTUAL, anAbility); |
| 4443 | parseFeatsHandleAppliedToAndSaveTags(it, cna); |
| 4444 | thePC.setDirty(true); |
| 4445 | } |
| 4446 | } |
| 4447 | |
| 4448 | /** |
| 4449 | * Parses the version information from a PCG file. |
no test coverage detected