private Rune GetRune(string parsedText) { Rune rune = new Rune(); string[] lines = parsedText.Split('\n'); int substatsCount = 0; foreach (string line in lines) { if (line.Trim().Length == 0) { continue; } if (rune.MainStat == null) { rune.MainStat = new Stat(line); } else { rune.SubStats.Add(new Stat(line)); substatsCount++; } } RuneRarity rarity = RuneRarity.Common; if (substatsCount == 1) { rarity = RuneRarity.Magic; } else if (substatsCount == 2) { rarity = RuneRarity.Rare; } else if (substatsCount == 3) { rarity = RuneRarity.Hero; } else if (substatsCount == 4) { rarity = RuneRarity.Legendary; } rune.Rarity = rarity; Console.WriteLine(rune.ToString()); return(rune); }
// a function used to set the rarity of the rune depending on the number that has been put in // - the int is the number that determines what rarity the rune will be public void SetRuneRarty(int RuneRarityNumber) { switch (RuneRarityNumber) { case (1): { Rarity = RuneRarity.common; RuneRarityName = "Common"; break; } case (2): { Rarity = RuneRarity.Uncommon; RuneRarityName = "Uncommon"; break; } case (3): { Rarity = RuneRarity.Rare; RuneRarityName = "Rare"; break; } case (4): { Rarity = RuneRarity.Epic; RuneRarityName = "Epic"; break; } case (5): { Rarity = RuneRarity.Legendary; RuneRarityName = "Legendary"; break; } } }