Beispiel #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)
            });
        }
Beispiel #2
0
 public abstract double GetObjectiveStrengthValue(ObjectiveType objectiveType);
 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));;
 }