(final String line)
| 3508 | * ############################################################### |
| 3509 | */ |
| 3510 | private void parseSkillLine(final String line) |
| 3511 | { |
| 3512 | final PCGTokenizer tokens; |
| 3513 | try |
| 3514 | { |
| 3515 | tokens = new PCGTokenizer(line); |
| 3516 | } |
| 3517 | catch (PCGParseException pcgpex) |
| 3518 | { |
| 3519 | final String message = |
| 3520 | "Illegal Skill line ignored: " + line + Constants.LINE_SEPARATOR + "Error: " + pcgpex.getMessage(); |
| 3521 | warnings.add(message); |
| 3522 | return; |
| 3523 | } |
| 3524 | Skill aSkill = null; |
| 3525 | final Iterator<PCGElement> it = tokens.getElements().iterator(); |
| 3526 | // the first element defines the skill key name!!! |
| 3527 | String skillKey = ""; |
| 3528 | if (it.hasNext()) |
| 3529 | { |
| 3530 | final PCGElement element = it.next(); |
| 3531 | skillKey = EntityEncoder.decode(element.getText()); |
| 3532 | aSkill = Globals.getContext().getReferenceContext().silentlyGetConstructedCDOMObject(Skill.class, skillKey); |
| 3533 | } |
| 3534 | while (it.hasNext()) |
| 3535 | { |
| 3536 | final PCGElement element = it.next(); |
| 3537 | final String tag = element.getName(); |
| 3538 | |
| 3539 | if (IOConstants.TAG_SYNERGY.equals(tag)) |
| 3540 | { |
| 3541 | // TODO |
| 3542 | // for now it's ok to ignore it! |
| 3543 | Logging.debugPrint(tag + " equals " + IOConstants.TAG_SYNERGY + " OK to ignore."); |
| 3544 | } |
| 3545 | else if (IOConstants.TAG_OUTPUTORDER.equals(tag)) |
| 3546 | { |
| 3547 | int outputindex = 0; |
| 3548 | try |
| 3549 | { |
| 3550 | outputindex = Integer.parseInt(element.getText()); |
| 3551 | } |
| 3552 | catch (NumberFormatException nfe) |
| 3553 | { |
| 3554 | // This is not critical. |
| 3555 | // Maybe warn the user? |
| 3556 | } |
| 3557 | |
| 3558 | if (aSkill != null) |
| 3559 | { |
| 3560 | thePC.setSkillOrder(aSkill, outputindex); |
| 3561 | } |
| 3562 | } |
| 3563 | else if (IOConstants.TAG_CLASSBOUGHT.equals(tag)) |
| 3564 | { |
| 3565 | PCGElement childClass = null; |
| 3566 | PCGElement childRanks = null; |
| 3567 | for (PCGElement child : element.getChildren()) |
no test coverage detected