// Get a suite of opponents for the desired number of games public List <PlayerSetup> GetOpponents(int numGames) { int curOpponentType = 0; int numTakenOfType = 0; var opponents = new List <PlayerSetup>(); // Distribute the games in a round robin fashion // based on the portions listed in the config file. while (opponents.Count < numGames) { if (numTakenOfType >= _opponentTypes[curOpponentType].Portion) { curOpponentType = (curOpponentType + 1) % _opponentTypes.Length; numTakenOfType = 0; } OpponentParams curType = _opponentTypes[curOpponentType]; Deck deck = _deckPools.GetDeck(curType.DeckPool, curType.DeckName); var opponent = new PlayerSetup(deck, PlayerSetup.GetStrategy(curType.Strategy, null)); opponents.Add(opponent); numTakenOfType++; } return(opponents); }
public GameDispatcher(PlayerSetup player, List <PlayerSetup> opponents) { // Save the configuration information. _player = player; _opponents = opponents; // Setup the statistics keeping. _usageCount = new Dictionary <string, int>(); _winCount = 0; _totalDamage = 0; _totalHealthDifference = 0; _totalTurns = 0; _totalCardsDrawn = 0; _totalHandSize = 0; _totalManaSpent = 0; _totalManaWasted = 0; _totalStrategyAlignment = 0; foreach (Card curCard in _player.Deck.CardList) { if (!_usageCount.ContainsKey(curCard.Name)) { _usageCount.Add(curCard.Name, 0); } } }
public GameEvaluator(PlayerSetup player, PlayerSetup opponent) { _player = player; _opponent = opponent; _cardUsage = new Dictionary <string, int>(); }