private void AddToTopOfTheList(RkConfigurationDto configuration) { if (!oldConfigurations.Any(x => x.Equals(configuration))) { //We keep only the ten last throws if (oldConfigurations.Count >= 10) { foreach (var exceedingIndex in Enumerable.Range(10, oldConfigurations.Count())) { oldConfigurations.RemoveAt(exceedingIndex); } } //Add it on the top of the list oldConfigurations.Insert(0, configuration); oldConfigurationList.SelectedItem = configuration; } }
public RkConfigurationDto BuildConfiguration(int roll, int keep, int addToResult) { var configuration = new RkConfigurationDto(roll, keep, addToResult); return(configuration); }
public RkLogic(RkConfigurationDto configuration) { Random = new Random(); Configuration = configuration; }
public RkLogic(int roll, int keep, int addToResult) { Random = new Random(); Configuration = BuildConfiguration(roll, keep, addToResult); }