Set the source of the domain. See getDomainSource() for details. This method should NOT be called outside of file i/o routines! @param aSource the source to be set
(String aSource)
| 5826 | * @param aSource the source to be set |
| 5827 | **/ |
| 5828 | public ClassSource getDomainSource(String aSource) |
| 5829 | { |
| 5830 | final StringTokenizer aTok = new StringTokenizer(aSource, "|", false); |
| 5831 | |
| 5832 | if (aTok.countTokens() < 2) |
| 5833 | { |
| 5834 | Logging.errorPrint("Invalid Domain Source:" + aSource); |
| 5835 | return null; |
| 5836 | } |
| 5837 | |
| 5838 | aTok.nextToken(); //Throw away "PCClass" |
| 5839 | |
| 5840 | String classString = aTok.nextToken(); |
| 5841 | PCClass cl = thePC.getClassKeyed(classString); |
| 5842 | if (cl == null) |
| 5843 | { |
| 5844 | Logging.errorPrint("Invalid Class in Domain Source:" + aSource); |
| 5845 | return null; |
| 5846 | } |
| 5847 | ClassSource cs; |
| 5848 | if (aTok.hasMoreTokens()) |
| 5849 | { |
| 5850 | int level = Integer.parseInt(aTok.nextToken()); |
| 5851 | cs = new ClassSource(cl, level); |
| 5852 | } |
| 5853 | else |
| 5854 | { |
| 5855 | cs = new ClassSource(cl); |
| 5856 | } |
| 5857 | return cs; |
| 5858 | } |
| 5859 | |
| 5860 | private void insertDefaultClassSpellLists() |
| 5861 | { |
no test coverage detected