/// <summary> /// Turn a JSON file into A Scenario - load /// </summary> /// <param name="sourceFileName"></param> /// <returns></returns> public Scene ConvertFormat(string sourceFileName) { DocumentStorage documentStorage = new JsonStorage(); Scene Scenario = _inputParser.ParseInput(documentStorage.GetData(sourceFileName)); return(Scenario); }
/// <summary> /// turn Scenario into a JSON object. - save /// </summary> /// <param name="scenario"></param> /// <param name="targetFileName"></param> /// <returns></returns> public bool ConvertFormat(Scene scenario, string targetlocation, string targetFileName) { var x = _documentSerializer.Serialize(scenario); DocumentStorage documentStorage = new JsonStorage(); documentStorage.PersistDocument(x, targetlocation, targetFileName); return(true); }