protected void AddRules(SimonRuleSet ruleSet, string key, int num) { ruleSet.RuleList.Add(key, new List <SimonColor[]>()); for (var i = 0; i <= num; i++) { var array = new SimonColor[Enum.GetNames(typeof(SimonColor)).Length]; for (var j = 0; j < Enum.GetNames(typeof(SimonColor)).Length; j++) { array[j] = (SimonColor)rand.Next(Enum.GetNames(typeof(SimonColor)).Length); } if (CommonReflectedTypeInfo.IsModdedSeed) { while (array.Distinct().Count() == 1) { array[rand.Next(Enum.GetNames(typeof(SimonColor)).Length)] = (SimonColor)rand.Next(Enum.GetNames(typeof(SimonColor)).Length); } } ruleSet.RuleList[key].Add(array); } }