code: public HashMap<String, Object> getJsonToken() throws Exception {
  
  		HashMap<String, Object> obj = new HashMap<String, Object>();
  
  		HashMap<String, Object> choiceThreads = null;
  		for (Choice c : currentChoices) {
  			c.originalThreadIndex = c.getThreadAtGeneration().threadIndex;
  
  			if (callStack.getThreadWithIndex(c.originalThreadIndex) == null) {
  				if (choiceThreads == null)
  					choiceThreads = new HashMap<String, Object>();
  
  				choiceThreads.put(Integer.toString(c.originalThreadIndex), c.getThreadAtGeneration().jsonToken());
  			}
  		}
  		if (choiceThreads != null)
  			obj.put("choiceThreads", choiceThreads);
  
  		obj.put("callstackThreads", callStack.getJsonToken());
  		obj.put("variablesState", variablesState.getjsonToken());
  
  		obj.put("evalStack", Json.listToJArray(evaluationStack));
  
  		obj.put("outputStream", Json.listToJArray(outputStream));
  
  		obj.put("currentChoices", Json.listToJArray(currentChoices));
  
  		if (!divertedPointer.isNull())
  			obj.put("currentDivertTarget", getDivertedPointer().getPath().getComponentsString());
  
  		obj.put("visitCounts", Json.intHashMapToJObject(visitCounts));
  		obj.put("turnIndices", Json.intHashMapToJObject(turnIndices));
  		obj.put("turnIdx", currentTurnIndex);
  		obj.put("storySeed", storySeed);
  		obj.put("previousRandom", previousRandom);
  
  		obj.put("inkSaveVersion", kInkSaveStateVersion);
  
  		// Not using this right now, but could do in future.
  		obj.put("inkFormatVersion", Story.inkVersionCurrent);
  
  		return obj;
  	}
docs: Object representation of full JSON state. Usually you should use LoadJson and
  ToJson since they serialise directly to String for you. But it may be useful
  to get the object representation so that you can integrate it into your own
  serialisation system.