public static void InitQuestionList() { questionList.Clear(); TextAsset csvData = SystemResourceController.Instance.LoadCSV("QuestionSystemCsv"); List <List <string> > csvQuestionList = CSVParserUtility.Parse(csvData.ToString()); for (int i = 1; i < csvQuestionList.Count; i++) { //0 FOR LEVELID, QUESTIONID FOR TESTING : LACKING VALUES questionList.Add(new QuestionRowModel( 0, CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "answer")[i].ToString(), int.Parse(CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "levelId")[i].ToString()), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "definition")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "synonym1")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "synonym2")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "antonym1")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "antonym2")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "clue1")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "clue2")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "clue3")[i].ToString(), CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "clue4")[i].ToString(), int.Parse(CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "de")[i].ToString()), int.Parse(CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "sy")[i].ToString()), int.Parse(CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "an")[i].ToString()), int.Parse(CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "cl")[i].ToString()) )); wrongChoices.Add(CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "choice1")[i].ToString() + "/" + CSVParserUtility.GetValueArrayFromKey(csvQuestionList, "choice2")[i].ToString() ); } }
//GET ALL SETTING VALUES FROM KEY VALUE CSV private static float[] GetPlayerSettingsFloatList(string csvName, int entryCount) { List <List <string> > settingsList; TextAsset csvData = SystemResourceController.Instance.LoadCSV(csvName); settingsList = CSVParserUtility.Parse(csvData.ToString()); float[] floatList = new float[entryCount]; for (int i = 1; i < settingsList.Count - 1; i++) { floatList [i - 1] = float.Parse(settingsList [i] [1].ToString()); } return(floatList); }
private static void InitCharacterConst() { TextAsset csvData = SystemResourceController.Instance.LoadCSV("Character"); characterConst = CSVParserUtility.Parse(csvData.ToString()); }
private static void InitQuestionConst() { TextAsset csvData = SystemResourceController.Instance.LoadCSV("QuestionConst"); questionConst = CSVParserUtility.Parse(csvData.ToString()); }