Exemple #1
0
        public override List <IByAgeSpeciesOption> GetOptions()
        {
            List <IByAgeSpeciesOption> results = new List <IByAgeSpeciesOption>();

            Dictionary <CASAGSAvailabilityFlags, List <InteractionTuning> > objects = new Dictionary <CASAGSAvailabilityFlags, List <InteractionTuning> >();

            foreach (InteractionTuning tuning in InteractionTuning.sAllTunings.Values)
            {
                foreach (CASAGSAvailabilityFlags ageSpecies in Retuner.AgeSpeciesToList(tuning.Availability.AgeSpeciesAvailabilityFlags))
                {
                    List <InteractionTuning> tunings;
                    if (!objects.TryGetValue(ageSpecies, out tunings))
                    {
                        tunings = new List <InteractionTuning>();
                        objects.Add(ageSpecies, tunings);
                    }

                    tunings.Add(tuning);
                }
            }

            foreach (KeyValuePair <CASAGSAvailabilityFlags, List <InteractionTuning> > pair in objects)
            {
                results.Add(new ByAgeSpeciesOption(pair.Key, pair.Value));
            }

            return(results);
        }
Exemple #2
0
 protected static List <CASAGSAvailabilityFlags> GetSettings(ActionData data)
 {
     SeasonSettings.ActionDataSetting settings = Retuner.SeasonSettings.GetSettings(data, false);
     if (settings != null)
     {
         List <CASAGSAvailabilityFlags> result;
         if (settings.GetTargetAgeSpecies(out result))
         {
             return(result);
         }
     }
     return(Retuner.AgeSpeciesToList(data.TargetAgeSpeciesAllowed));
 }
Exemple #3
0
        protected static List <CASAGSAvailabilityFlags> GetSettings(InteractionTuning tuning)
        {
            SeasonSettings.ITUNSettings settings = Retuner.SeasonSettings.GetSettings(tuning, false);
            if (settings != null)
            {
                List <CASAGSAvailabilityFlags> result;
                if (settings.GetAgeSpecies(out result))
                {
                    return(result);
                }
            }

            return(Retuner.AgeSpeciesToList(tuning.Availability.AgeSpeciesAvailabilityFlags));
        }