Пример #1
0
 protected FeatureEvolution(
     Range <PersonAge> ageRange,
     FeatureImprovementRatio maxImprovement,
     EvolutionCurve evolutionCurve)
 {
     AgeRange = ageRange;
     MaxFeatureImprovement = maxImprovement;
     EvolutionCurve        = evolutionCurve;
 }
Пример #2
0
        public AgeRating ImproveRatingFromAge(AgeRating currentAgeRating, Duration evolutionDuration)
        {
            if (currentAgeRating is null)
            {
                throw new ArgumentNullException(nameof(currentAgeRating));
            }
            if (evolutionDuration is null)
            {
                throw new ArgumentNullException(nameof(evolutionDuration));
            }

            // on ajoute la durée à l'âge du joueur (PersonAge + Duration = PersonAge)
            PersonAge futureAge = currentAgeRating.Age + evolutionDuration;

            FeatureImprovementRatio improvement = GetImprovementFromAge(futureAge) - GetImprovementFromAge(currentAgeRating.Age);

            return(new AgeRating(futureAge, improvement.ImproveRating(currentAgeRating.Rating)));
        }
Пример #3
0
 private Phase3Evolution(Range <PersonAge> ageRange, FeatureImprovementRatio maxImprovement, EvolutionCurve evolutionCurve)
     : base(ageRange, maxImprovement, evolutionCurve)
 {
 }