#include "venues.hpp" #include #include "oop_algos.hpp" namespace cs427_527 { void TeamVenues::addGame(const string& venue) { if (counts.count(venue) == 0) { counts[venue] = 1; distinct.push_back(venue); } else { counts[venue]++; } sequence.push_back(venue); } typename TeamVenues::const_iterator TeamVenues::begin() const { return distinct.begin(); } typename TeamVenues::const_iterator TeamVenues::end() const { return distinct.end(); } vector TeamVenues::games(const string& venue) const { vector gameIndices; cs427_527::find_indices(sequence.begin(), sequence.end(), std::back_inserter(gameIndices), venue); return gameIndices; } void VenueHistory::addGame(const string& team1, const string& team2, const string& venue) { venues[team1].addGame(venue); venues[team2].addGame(venue); } typename VenueHistory::const_iterator VenueHistory::begin() const { return venues.begin(); } typename VenueHistory::const_iterator VenueHistory::end() const { return venues.end(); } }