public Score this[ClassificationKey key] { get { return(_scores[key]); } }
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); }
public bool ContainsKey(ClassificationKey key) { return(_scores.ContainsKey(key)); }