示例#1
0
 public Score this[ClassificationKey key]
 {
     get
     {
         return(_scores[key]);
     }
 }
示例#2
0
        public Classifier(
            IEnumerable <string> myRobots,
            IEnumerable <string> allRobots, ScoreBoard scoreboard)
        {
            Classifications = myRobots
                              .SelectMany(myRobotName =>
                                          Enum.GetValues(typeof(BattleType)).Cast <BattleType>().SelectMany(battleType =>
            {
                return(allRobots.Select(enemyRobotName =>
                {
                    var key = new ClassificationKey(myRobotName, battleType, enemyRobotName);

                    ClassificationValue value;

                    if (scoreboard.ContainsKey(key))
                    {
                        var score = scoreboard[key];

                        value = new ClassificationValue(score.Classification, score.Total);
                    }
                    else
                    {
                        value = new ClassificationValue(RobotClassification.New, 0);
                    }

                    return new { Key = key, Value = value };
                }));
            }))
                              .ToDictionary(
                k => k.Key,
                v => v.Value);
        }
示例#3
0
 public bool ContainsKey(ClassificationKey key)
 {
     return(_scores.ContainsKey(key));
 }