(InputStream in)
| 547 | } |
| 548 | |
| 549 | @Nullable |
| 550 | private SourceSelectionFacade internalReadSources(InputStream in) |
| 551 | { |
| 552 | // Read lines from file |
| 553 | final List<String> lines = readPcgLines(in); |
| 554 | |
| 555 | // Verify it is ver2 |
| 556 | boolean isPCGVersion2 = isPCGCersion2(lines); |
| 557 | |
| 558 | final String[] pcgLines = lines.toArray(new String[0]); |
| 559 | |
| 560 | if (isPCGVersion2) |
| 561 | { |
| 562 | //PlayerCharacter aPC = new PlayerCharacter(); |
| 563 | final PCGParser parser = new PCGVer2Parser(null); |
| 564 | try |
| 565 | { |
| 566 | // Extract list of sources |
| 567 | return parser.parcePCGSourceOnly(pcgLines); |
| 568 | } catch (PCGParseException pcgex) |
| 569 | { |
| 570 | errors.add(pcgex.getMessage() + Constants.LINE_SEPARATOR + "Method: " + pcgex.getMethod() + '\n' |
| 571 | + "Line: " + pcgex.getLine()); |
| 572 | } |
| 573 | |
| 574 | warnings.addAll(parser.getWarnings()); |
| 575 | } else |
| 576 | { |
| 577 | errors.add("Cannot open PCG file"); |
| 578 | } |
| 579 | |
| 580 | return null; |
| 581 | } |
| 582 | |
| 583 | } |
no test coverage detected