예제 #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)
 {
 }