public void PotionSelected(PotionType type) { if (second == false) { firstPotion = type; second = true; } else { List <DivinationResult> firstMatch = divinationResults.FindAll(toCheck => toCheck.first == firstPotion); DivinationResult secondMatch = firstMatch.Find(toCheck => toCheck.second == type); result.text = secondMatch.result; second = false; } }
private void ParseResultsCSV() { CSVContent = File.ReadAllText(Application.streamingAssetsPath + "/results.csv"); string[] lines = CSVContent.Split('\n'); for (int i = 1; i < lines.Length; i++) { string[] columns = SplitCsvLine(lines[i]); for (int j = 1; j < columns.Length - 1; j++) { DivinationResult currentResult = new DivinationResult(); currentResult.first = (PotionType)(j - 1); currentResult.second = (PotionType)(i - 1); currentResult.result = columns[j]; divinationResults.Add(currentResult); } } }