Ejemplo n.º 1
0
 public static PersistentTransitionChoice<?> processOldAdd(LoadContext context, String first)
     throws PersistenceLayerException {
   int openParenLoc = first.indexOf('(');
   if (openParenLoc == -1) {
     Logging.errorPrint("Expected to have a ( : " + first);
     return null;
   }
   int closeParenLoc = first.lastIndexOf(')');
   if (openParenLoc == -1) {
     Logging.errorPrint("Expected to have a ) : " + first);
     return null;
   }
   String key = first.substring(7, openParenLoc);
   String choices = first.substring(openParenLoc + 1, closeParenLoc);
   String count = "";
   if (closeParenLoc != first.length() - 1) {
     count = first.substring(closeParenLoc + 1) + '|';
   }
   PCClass applied = new PCClass();
   ParseResult pr = context.processSubToken(applied, "ADD", key, count + choices);
   pr.printMessages();
   if (!pr.passed()) {
     return null;
   }
   context.commit();
   PersistentTransitionChoice<?> ptc = applied.getListFor(ListKey.ADD).get(0);
   return ptc;
 }
 protected void finishLoad() {
   context.commit();
   SourceFileLoader.processFactDefinitions(context);
   context.getReferenceContext().buildDeferredObjects();
   context.getReferenceContext().buildDerivedObjects();
   context.resolveDeferredTokens();
   assertTrue(context.getReferenceContext().resolveReferences(null));
   context.resolvePostDeferredTokens();
   context.loadCampaignFacets();
   pc = new PlayerCharacter();
   id = pc.getCharID();
 }