private void GetDataFromJson() { JsonParserGame <Dictionary <string, List <string> > > jsonData = new JsonParserGame <Dictionary <string, List <string> > >(); var dataText = jsonData.GetData("JsonDataPatternLevels", "JsonDataPatternLevels"); dataLevels.WordDict = dataText; }
private void GetDataFromJson() { JsonParserGame <Dictionary <string, List <string> > > jsonData = new JsonParserGame <Dictionary <string, List <string> > >(); var dataText = jsonData.GetData("JsonDataHomeLevels", "JsonDataHomeLevel2"); dataLevel.NameDirDict = dataText; }
private void GetDataFromJson() { JsonParserGame <Dictionary <string, List <string> > > jsonData = new JsonParserGame <Dictionary <string, List <string> > >(); var dataText = jsonData.GetData("JsonDataHomeLevels", "JsonDataHomeLevel0"); dataLevel.StartSentence = dataText["StartSentence"][0]; dataText.Remove("StartSentence"); dataLevel.NameDirDict = dataText; }
private void LoadDataSounds() { dataSounds = new DataSounds(); JsonParserGame <Dictionary <string, List <string> > > jsonData = new JsonParserGame <Dictionary <string, List <string> > >(); try { dataSounds.SoundNameList = jsonData.GetData("JsonDataSounds", "JsonDataSounds")["Sounds"]; } catch (KeyNotFoundException e) { } }
protected virtual void GetDataFromJson(string path) { JsonParserGame <Dictionary <string, List <string> > > jsonData = new JsonParserGame <Dictionary <string, List <string> > >(); nameItemsList = new List <Dictionary <string, List <string> > > { jsonData.GetData(path, "Objectives"), jsonData.GetData(path, "Adjectives"), jsonData.GetData(path, "Signs") }; ShuffleItemList(); foreach (var data in nameItemsList) { try { dataLevel.NameDirDict = dataLevel.NameDirDict .Concat(data) .ToDictionary(x => x.Key, x => x.Value); } catch (ArgumentException) { } } foreach (var data in dataLevel.NameDirDict) { for (int i = 0; i < data.Value.Count; i++) { if (data.Value[i] == "") { data.Value[i] = data.Key; } } } }