コード例 #1
0
 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;
     }
 }
コード例 #2
0
        public RkConfigurationDto BuildConfiguration(int roll, int keep, int addToResult)
        {
            var configuration = new RkConfigurationDto(roll, keep, addToResult);

            return(configuration);
        }
コード例 #3
0
 public RkLogic(RkConfigurationDto configuration)
 {
     Random        = new Random();
     Configuration = configuration;
 }
コード例 #4
0
 public RkLogic(int roll, int keep, int addToResult)
 {
     Random        = new Random();
     Configuration = BuildConfiguration(roll, keep, addToResult);
 }