//Loads the phase from a .json file, and returns a dictionary of phases public static Dictionary <int, Dictionary <string, string> > LoadPhases(string directory) { JSONEditor jsonEditor = new JSONEditor(directory); Dictionary <int, Dictionary <string, string> > phase = new Dictionary <int, Dictionary <string, string> > (); for (int i = 0; i < jsonEditor.NumberOfObjects(); i++) { phase.Add(i, PhasesSaver.LoadStep(jsonEditor, i)); } return(phase); }
/// <summary> /// Start CustomMode, triggering all the other entities to read the needed information. /// </summary> private void StartCustomMode() { bool glasswareStart = false; customMode = true; currentPhase = PhasesSaver.LoadPhases(customPhaseDirectory); phaseDefinitions = PhasesSaver.GetPhaseLibrary(customPhaseDirectory); numberOfSteps = currentPhase.Count; this.NewPhase(bool.Parse(phaseDefinitions ["glasswareStart"])); }
//Loads the phase from a .json file, and returns a dictionary of phases public static Dictionary <int, Dictionary <string, string> > LoadPhases(string directory) { JSONEditor jsonEditor = new JSONEditor(directory); Dictionary <int, Dictionary <string, string> > phase = new Dictionary <int, Dictionary <string, string> > (); Debug.Log("Number of steps = " + jsonEditor.NumberOfObjects()); for (int i = 0; i < jsonEditor.NumberOfObjects(); i++) { phase.Add(i, PhasesSaver.LoadStep(jsonEditor, i)); Debug.Log("Adicionando step = " + phase[i]["typeOfStep"]); } return(phase); }
/// <summary> /// Start CustomMode, triggering all the other entities to read the needed information. /// </summary> private void StartCustomMode() { bool glasswareStart = false; customMode = true; currentPhase = PhasesSaver.LoadPhases(customPhaseDirectory); phaseDefinitions = PhasesSaver.GetPhaseLibrary(customPhaseDirectory); for (int i = 0; i < currentPhase.Count; i++) { Debug.Log("PC.CurrentPhase " + i + " = " + currentPhase[i]["typeOfStep"]); } numberOfSteps = currentPhase.Count; this.NewPhase(bool.Parse(phaseDefinitions ["glasswareStart"])); }