예제 #1
0
        public Weight CalculateWeight(IEnumerable <Hero> enemyTeam, IEnumerable <Hero> team, ObjectiveType objectiveType)
        {
            var counterValue = enemyTeam.Any()
                               ? (int)enemyTeam.Average(this.GetStrengthAgainstValue)
                               : 50;
            var synergyValue = team.Any()
                               ? (int)team.Average(this.GetSynergyValue)
                               : 50;

            var objectiveValue = GetObjectiveStrengthValue(objectiveType);

            return(new Weight()
            {
                Hero = this,
                Value = (counterValue * CountersMultiplier + synergyValue * SynergyMultiplier) / 2.0 * (objectiveValue * ObjectiveMultiplier)
            });
        }
예제 #2
0
 public abstract double GetObjectiveStrengthValue(ObjectiveType objectiveType);
예제 #3
0
 public static IEnumerable <Weight> GetOverallScoresForAllHeroes(IEnumerable <Hero> enemyTeam, IEnumerable <Hero> team, ObjectiveType objectiveType)
 {
     return(Heroes.Select(h => h.CalculateWeight(enemyTeam, team, objectiveType)).SuppressDuplicates(team).OrderByDescending(w => w.Value));;
 }